A christmas present from the 3D departement

A christmas present from the 3D departement

Postby samuncle » 24 Dec 2013, 04:38

Hello everybody :)

We are working hard to improve the visual quality of supertuxkart. During the GSoC cand implemented several cool stuff (like a better light system etc).
STK is getting slowly but surely into the next gen area. We have started to use default 1k textures (and maybe we will switch to 2k for some important objects).

So, for chrismas, here is some exclusive screenshoot of harvest. Like real studios we have heavily photoshoped :p they aren't modified, It's the real rendering quality in 1080p :)
(please be aware. It's still WIP)
Image
Image
Image
Image


The difference between the 512px and 2k textures (2048px) (for the grass)
Image

Many people complained about the darkness of the previous release. As I said your complains were taken into account :) and I can show you the result.
I have quickly (and dirty) converted the old mine to the new light system so programmers, artists, etc can test it.
Image
Image
Image
Image
And the traditional before/after
Image


thanks to Vlj who is improving our shader pipeline

Merry christmas for everybody :)
Last edited by samuncle on 25 Dec 2013, 07:01, edited 1 time in total.
Image
User avatar
samuncle
 
Posts: 365
Joined: 16 Mar 2010, 21:28

Re: A christmas present from the 3D departement

Postby Funto » 24 Dec 2013, 11:23

Cool work, and merry Christmas :)

Some remarks:
- where did the shadows go?
- I'm not really in favor of using _that_ big textures...on the example that you showed with the grass, I would go with the 512px texture + a tiled detail texture, that uses the same UV times a factor > 1. Big textures should not be used for the fact of using big textures, but for adding details where needed :) (what does cand's mipviz tool say?)
Funto
 
Posts: 450
Joined: 09 Dec 2009, 13:47
Location: Bordeaux, France

Re: A christmas present from the 3D departement

Postby samuncle » 24 Dec 2013, 13:42

@funto
- where did the shadows go?

Currently we are focused on the lighting system. Shadows will be done later.

- I'm not really in favor of using _that_ big textures

I just consider the possibility. Of course not all texture will be 2k. What is currently planned is using 1k or even 2k for generic texture (generic texture are tillable repetitive texture shared by many object).
For example the wood texture
Image
I will always use the best quality. We can still resize them later by 50% if needed and we can release a HD pack (vice versa, a default HD pack and an optimized version). But I want to wait the texture compression before speculating about the texture size.

I would go with the 512px texture + a tiled detail texture, that uses the same UV times a factor > 1. Big textures should not be used for the fact of using big textures

It's already the case ;). Currently you have several generic high quality texture that are used by many object. On top of that you have a texture with baked ambient occlusion + detail map to provide variations and to break the repetitive aspect of the generic texture. You have also what is called tattoo. It's an alpha testing plane on top of another object to provide extra detail (like the company name painted on the grain elevator).
* A generic texture will have a resolution of 1k or 2k
* A detail texture (ambient occlusion + hand painted detail) will depend on the importance of the object. For instance 1k for the grain elevator but only 256 for the pumpkin.
* An easy optimization that is already possible is to not load the detail map and tattoos (and that's why I like this system of a generic_ texture + a detail map). Of course objects may look strange (since some detail map are used to provide the color), but you will save VRAM and the game will run smoother if you have a low end GPU
* Also very tiny detail (like lantern, furniture, etc) will be flagged as details directly in the library. You can easily imagine an option to not load them if needed

but for adding details where needed

Yes of course :) (I'm not a marketing guy). I use 1k for two reason
* To have more details
* To avoid easy to spot repetitive pattern

Keep in mind that there is only few generic textures (maybe 10 or 15), so they have to be beautiful and very good looking

(what does cand's mipviz tool say?)

It says that the density is correct where the player is (which is the most important).

But don't panic currently my biggest fear is the VRAM usage. That's why I came up with the idea of repetitive generic texture and an optional detail map that you can disable, and we need texture compression soon as possible.
Image
User avatar
samuncle
 
Posts: 365
Joined: 16 Mar 2010, 21:28

Re: A christmas present from the 3D departement

Postby samuncle » 25 Dec 2013, 07:02

I have updated the first post to show the old mine with the new light system :)
Image
User avatar
samuncle
 
Posts: 365
Joined: 16 Mar 2010, 21:28

Re: A christmas present from the 3D departement

Postby Funto » 25 Dec 2013, 10:00

Ok.
I'd like to add also that VRAM usage isn't the only thing to consider when putting big textures: big textures reduce the overall performance because of their higher usage of the texture cache.
When a texel is fetched from a shader, the texels around the fetched texel are put in a fast memory zone (the texture cache), which can be read during the following texture fetches if the value stored is the one we want to fetch (otherwise that's a cache miss).
If you have a lower res texture, where a given texel covers several pixels, the values in the cache will be valid for a larger part of the screen than if you have a high-res texture.
BTW, are all textures mipmapped? (I suppose so, but I don't remember...)

EDIT: BTW, old mine looks much better IMO :)
Funto
 
Posts: 450
Joined: 09 Dec 2009, 13:47
Location: Bordeaux, France

Re: A christmas present from the 3D departement

Postby Totoplus62 » 25 Dec 2013, 11:27

Image
Image
"Imagination is more important than knowledge." Features under CC-BY 3.0, CC-BY-SA 3.0 or equivalent GNU license
Image SuperTuxKart Popularity
User avatar
Totoplus62
 
Posts: 550
Joined: 10 Nov 2012, 13:33
Location: France - Pas-de-Calais

Re: A christmas present from the 3D departement

Postby CA99 » 02 Jan 2014, 03:43

I posted my thoughts about this update on FB, but I'll reiterate them here. Sorry for the week-late post.

First has already been covered: I don't know if even 1k textures are needed for many small environmental/background objects. I've been able to get a good amount of detail out of a 1024^2 texture for a wood pallet by a single repeat, but the result is very detailed and the normal map does a lot of the heavy lifting.

http://imageshack.us/a/img848/4118/newpallet.png

For complex objects like characters and karts, I'm all for having 2048^2 textures. Terrains may need up to 4096^2 for their color map, and obviously, terrain is pretty important for something like STK. Terrain however, requires a complex system of texture layerings, masks, etc., and I'm not really sure how artists create it in 3D modeling software without using special tools.

The lighting experiment looks fantastic so far. I'm wondering if we'll see dynamic shadows, soft-edge particles, SSAO, normal/specular maps, and other modern shader effects soon? Although the latter (normal/specular mapping) is more work on artists, and I think we'd do well to focus on graphical features that don't require that much more artists' work first. Even bad models and game art don't look so bad when situated with good lighting effects.

As far as high res textures go, IMO, the textures should all be high res, then have an in-game setting that loads only lower resolution textures for the old video cards. That said, I'm not sure if the game engine would support this.
CA99
 
Posts: 3
Joined: 28 Sep 2012, 20:25

Re: A christmas present from the 3D departement

Postby samuncle » 02 Jan 2014, 06:41

@CA99 thanks for your answer :)
First has already been covered: I don't know if even 1k textures are needed for many small environmental/background objects. I've been able to get a good amount of detail out of a 1024^2 texture for a wood pallet by a single repeat, but the result is very detailed and the normal map does a lot of the heavy lifting.

Currently the idea is a bit different of what regular games do.

STK will mainly have two kind of texture.
* High quality 1k or 2k Generic textures (like wood, metal, etc) they can be tiled seamlessly.
* Detail map used by single object to provide the color, and some details (like vegetation over the wood texture). They depends on the size of the object and its importance in tracks.

So we can use the high quality generic grayish wood texture for the grain elevator (the red building in harvest) and add another layer on top, the detail map that will provide the red painted surface, and other things like ambient occlusion.

So even a small object in the background can use a high detailed texture since the texture is already used by another object close to the camera.

In your example we will use two textures. The generic 2k wood texture + a palette detail texture, maybe 512 will be enough to provide things like bolts or moss growing in an old palette.

For complex objects like characters and karts, I'm all for having 2048^2 textures. Terrains may need up to 4096^2 for their color map, and obviously, terrain is pretty important for something like STK. Terrain however, requires a complex system of texture layerings, masks, etc., and I'm not really sure how artists create it in 3D modeling software without using special tools.

In comparison of other games stk characters are very small in the screen. So 1k (1024) may be enough. For the terrain we will use generic textures + a splatting map (probably what you call a color map).
Sadly splatting is a very costly effect so we can't use raw 2048 splatting map. But I'm looking for some trick to avoid the problem and to fake a higher resolution.

The lighting experiment looks fantastic so far. I'm wondering if we'll see dynamic shadows, soft-edge particles, SSAO, normal/specular maps, and other modern shader effects soon? Although the latter (normal/specular mapping) is more work on artists, and I think we'd do well to focus on graphical features that don't require that much more artists' work first.

* Dynamic shadows are a planned feature. But obviously it's not an easy thing
* GPU soft particles are done. But it's still WIP.
* SSAO is done. Used in both demo (harvest & mine)
* Normal mapping and specular mapping is done. We already use specular map in the mine (unfortunately not all texture), but sure it's available. Maybe I will have a way to generate them automatically :)
* There is also a list of planned features.
Even bad models and game art don't look so bad when situated with good lighting effects

Unfortunately it's not the case. The vast majority of our objects have issues with normals, etc. So even with all theses fancy effect the result is pretty bad (since these algorithms need a right normal value).
Image
User avatar
samuncle
 
Posts: 365
Joined: 16 Mar 2010, 21:28

Re: A christmas present from the 3D departement

Postby cand » 03 Jan 2014, 12:51

Looking good!

However I noticed that Vincent severely upped the HW requirements, and required floats (so future STK cannot run on US-based distros). Both were explicit design decisions in my work, and I find it sad to immediately turn them around on their head as soon as I'm gone.
cand
 
Posts: 28
Joined: 26 Jun 2013, 20:16

Re: A christmas present from the 3D departement

Postby vlj » 03 Jan 2014, 18:22

Regarding texture floats, I think the patent will expire in a couple of years. In the meantime the floating point texture will only affect users of Mesa living in country were this patent is registered. Others have the ability to use package from unofficial repo (rpm fusion for fedora) or to build mesa themselve (that what I do). And of course not every stk player uses linux with open source driver, in this case there is no legal restriction.
Regarding opengl 3.+ requirement, more and more oss game like unvanquished already took this decision. This make the game unable to run the shader pipeline on pre 2006 hardware but on the other hand it makes development simpler (for instance it's possible to have non perspective corrected normals without unprojecting them in fragment shader and thus correct light shading) and provide some tool to improve performance (like vao, or tfb particles). I'm trying to keep e350 running r600g driver as target hardware (that's why I don't want to use geometry shader yet), currently I get 15 fps on old mine track but there is room for improvement by tweaking the simultaneous light displayed on screen.
vlj
 
Posts: 18
Joined: 27 Dec 2013, 04:22

Re: A christmas present from the 3D departement

Postby Auria » 04 Jan 2014, 00:38

Hi cand,

cand wrote:Looking good!

However I noticed that Vincent severely upped the HW requirements, and required floats (so future STK cannot run on US-based distros). Both were explicit design decisions in my work, and I find it sad to immediately turn them around on their head as soon as I'm gone.


I hear you and I also want to support older hardware as much as I can. But we did a few tests and the lights were simply not workable in real-world cases without the use of HDR. Either the sun would wash lights away, if there was a sun; or lights would just saturate to white. So in the end there was little choice to upgrade, since otherwise it would have been difficult for us to use the new pipeline to produce the results we wanted

Also clearly we're not done yet, we will go through a couple more iterations of testing and refinements to eventually settle on the best possible compromise
Image
User avatar
Auria
STK Moderator
 
Posts: 2484
Joined: 07 Dec 2009, 03:52

Re: A christmas present from the 3D departement

Postby cand » 04 Jan 2014, 10:39

vlj wrote:Regarding texture floats, I think the patent will expire in a couple of years. In the meantime the floating point texture will only affect users of Mesa living in country were this patent is registered. Others have the ability to use package from unofficial repo (rpm fusion for fedora) or to build mesa themselve (that what I do). And of course not every stk player uses linux with open source driver, in this case there is no legal restriction.


In 2017 IIRC. As the userbase is mainly casual, they won't know about such extra repos, or if they know, won't want to go the extra trouble since it could break their systems.

Even less will they be able to build Mesa.
cand
 
Posts: 28
Joined: 26 Jun 2013, 20:16

Re: A christmas present from the 3D departement

Postby cand » 04 Jan 2014, 10:44

@Auria

I don't see any HDR there yet, so I assume it's TBD. Floats are not required for HDR, 16-bit ints could have been used just as well. Using such would allow 256 lights stacked at the same pixel, at the same precision.
cand
 
Posts: 28
Joined: 26 Jun 2013, 20:16

Re: A christmas present from the 3D departement

Postby vlj » 05 Jan 2014, 20:23

Unfortunatly irrlicht doesn't support 16 bits per component int textures...
vlj
 
Posts: 18
Joined: 27 Dec 2013, 04:22

Re: A christmas present from the 3D departement

Postby cand » 06 Jan 2014, 11:33

Adding a texture format to irr is easy, as for RTT formats you don't need to add the cpu handling (SImage support). It's just adding an enum in a couple places.

I believe I added some red-green optimized formats, you should be able to find them in the cand/final branch, to use as an example.


edit: I see there was some misunderstanding about my post above in IRC. I do approve of the light changes etc, it's only the two things mentioned above I disagree with.
cand
 
Posts: 28
Joined: 26 Jun 2013, 20:16

Re: A christmas present from the 3D departement

Postby vlj » 08 Jan 2014, 17:36

I will have a look at it later then, I need to finish the gpuparticle system before.
vlj
 
Posts: 18
Joined: 27 Dec 2013, 04:22

Re: A christmas present from the 3D departement

Postby MCMic » 08 Jan 2014, 19:24

Couldn't STK have 3D grass? Is there some code out there easy to use that render it?
I think both sides looks ugly on the 512vs1k grass screenshot.
User avatar
MCMic
 
Posts: 622
Joined: 05 Jan 2010, 17:40

Who is online

Users browsing this forum: No registered users and 1 guest