Audi R18 2012 - Wip (no release)

Discussion in 'Vehicles' started by tommy86, May 11, 2012.

Thread Status:
Not open for further replies.
  1. MaXyM

    MaXyM Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,774
    Likes Received:
    29
    @KS, Sorry I didn't knew that. Could you check thread subject? ;)

    @ethone, I got your point. And I agree with you. Things should be optimized.
    One note: texture mapped on some 3d objects is always distorted in some way (by perspective, but angle view etc). that's why you will probably always get better quality by using larger texture, scaled by gfx engine, than smaller texture matched output resolution.
     
  2. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Maybe instead of asking you should read tommy86's post again: LINK.
    I'm pretty sure discussion between You and Johannes wasn't as helpful as my discussion with ethone. Especially that neither me or ethone try to prove any point or convince anyone to our opinions, while you and Johannes do just that.


    So back to usefull discussion... :)

    When game engine performs frustum culling and considers some object to be out of view, it will not make a render call for it. In this case all the geometry and textures simply occupy some VRAM but do not affect performance.
    Occlusion query will pretty much work the same - if query gives negative answer, object is not rendered by game engine.

    Note that game engine can perform this culling on different levels. For example - occlusion query may be performed for an entire area (lie a room or 100 meters of track) with all objects in it. Same goes for frustum culling.

    So if pedals in cockpit are not in view, it doesn't mean render call isn't made for them by game engine. Game engine may just simply render everything that's in a GMT file if this GMT file is in view. rFactor had separate cockpit instance, but in rF23 it's no longer the case. So in case of rF2 it could mean that render call for pedals won't be made if they're in separate GMT file.
    It all depends if rF2 will perform frustum culling once for a car, or perhaps once for a GMT file, or maybe even once for every object in GMT file. Or maybe objects get regrouped after being loaded by rF2 engine and frustum culling is performed on groups.

    But generally - game engine should skip objects that are out of view. Excluding them precisely would be too complex so simple and fast methods are used. For example - object is encapsulated in a sphere and if that sphere is within it's radius from edge of view, then "it's possible" that object is in view and render call will be made for it.
    In this case it may still happen, that polygons are actually out of view, but that will only be known after all of them were projected onto screen. What matters is that render call is made and graphics card will need all textures transfered back to VRAM (in case they fell out) just in case one of polygons will end up on screen while rendering.

    Whenever any pixels will be actualy rendered doesn't matter. Polygon may be out of view, or hidden behind something and therefore eliminated by z-buffering. Textures need to be ready anyway, but they will not be accessed if no pixel is drawn. So as long as they all fit into VRAM don't need to be transfered, it will not impact performance.


    Current GPU's support conditional rendering. It allows frustum culling to be performend on GPU, so you may draw more stuff with less draw calls. Things may be different in this case, but it's not supported in DirectX 9, so it doesn't concern us.
     
    Last edited by a moderator: May 18, 2012
  3. tommy86

    tommy86 Registered

    Joined:
    Jan 10, 2012
    Messages:
    161
    Likes Received:
    4
    I hope that rf2 works like you write, K. It's aboslutely unuseful to render hidden objects because this mean a lot of calculation that can't be seen. But I'm sure this doesn't happens in rf2 :)

    There is also texture reduction based on distance view? This is a need, if it's not already in it, imho. Pixel blending an mipmaps are useful but doesn't reduce texture size, so you're gonna see a 1024px texture also from distance. Isn't it?

    cheers :)
     
  4. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Yes, basically every game has view frustum culling.
    rF2 has currently some problems with it - especially with finding which shadow casters affect visible part of scene, but it will be fixed eventually.

    As for texture reduction - that's actually mipmapping. If you have 1024x1024 texture, it's considered to be a level 0 mipmap. Then 512x512 version of this texture is considered level 1 mipmap and so on. These mipmaps are stored in .dds files and in case of other formats, like .bmp or .tga they're created by game engine or graphics driver before being sent to GPU.

    So you don't have to worry about that kind of stuff - objects that are out of view will not be processed (it's only a matter of what game engine considers to be an object) and textures that occupy less space on screen will use mipmaps.

    Your concerns are not to create too manyu unnecessary objects and not to create a mod that would have problems fitting into VRAM.
    There are unique textures in every car (these used for car skin, driver suit, helmet and so on). These textures cannot occupy too much memory. Make a bigger car skin texture if you wish, but smaller driver suit and helmet.
     
    Last edited by a moderator: May 18, 2012
  5. Vince Klortho

    Vince Klortho Registered

    Joined:
    Oct 5, 2010
    Messages:
    91
    Likes Received:
    1
    I agree with your point but there is one small thing : if the original texture was 1024x1024 and it were shrunk to 256x256 that would be a reduction of 16X in memory used since it is 4x4. :)

    Actually even with DDS textures this relation holds since it has a constant compression ratio even with mipmaps. I checked out a few actual files and a 1Kx1K DXT1 file is 699K and a 256x256 DXT file is 44K, rounded, and that is a factor 16 reduction. Even with alpha channels the reduction will be the same.

    This is exactly the problem I have seen with several recent mods. They use very large textures where they aren't needed and the mapping and material usage is inefficient, forcing each car to have unique textures that could and should have been shared.
     
  6. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Yes, these compression algorithms offer constant rate. With DXT1 you get 8:1 ratio in VRAM usage and with others you get 4:1. If you need good alpha channel you need DXT5, but for RGB textures DXT1 is enough.

    The reason why .dds files have sizes around 1/3 larger than expected (so 669k instead of 512k or 44k instead of 32k) is because they also contain mipmaps. So file actually contains multiple images (256x256, 128x128, 64x64 and so on).

    So for 256x256 texture we have 32k for first mipmap, 8k for second mipmap, 2k for third mipmap - that's 42k allready. A few more mipmaps, file header and we have 44k.

    One more thing worth mentioning about DXT compression is that it can have different quality. DXT format itself have no quality settings, but different graphic programs may use better or worse compression algorithms when saving DXT file.
    If software you use to save DXT files will have poor compression algorithms, you may end up with textures looking like this:

    [​IMG]
    [​IMG]

    When I want good quality, I use NVIDIA tools to compress textures.
     
    Last edited by a moderator: May 19, 2012
  7. Vince Klortho

    Vince Klortho Registered

    Joined:
    Oct 5, 2010
    Messages:
    91
    Likes Received:
    1
    I have seen that effect at times. Actually, the big difference in formats is DXT1 is 4-bits per pixels whereas DXT3 and DXT5 are 8-bits per pixel with different alpha channel types. If I see heavy pixellation like in your images I use DXT3 if the image has no alpha channel and usually the pixellation goes away. DXT3 can also used for images with chroma-keyed transparency since has an 'explicit' alpha channel as opposed to the interpolated one of DXT5.

    So, how about that R18? It looks really good ! :)
     
  8. MaXyM

    MaXyM Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,774
    Likes Received:
    29
    And one more thing: as KS said, if you provide textures in non-dds format (like TGA) these will be dds compressed while loading into memory. Again it depends on compression algorithm, but i found rF1 algorithm significantly worse then offered by nVidia tools.
    It does especially matter in case of normal maps - for this kind of bitmaps you should select special compression mode.

    Some time ago I though that using tga files, I will get better quality (since DDS is lossy compression). ather compress it with best algo available rather then let the job for game engine.
     
  9. tommy86

    tommy86 Registered

    Joined:
    Jan 10, 2012
    Messages:
    161
    Likes Received:
    4
  10. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Honestly it doesn't look to me like UV mapping is finished.

    1. Too many gaps - you should utilize empty space better. Move some parts.
    2. Some polygons at edges are missing (because they got attached to edge of some other element on the UV map) - correct that
    3. UV map covers only half of the car. That's not gonna work - you need entire car unwrapped for skinning. Painting itself may be done like this, but you can't put sponsor logos nor car numbers unless you have both sides of the car mapped
    4. See if you can change arrangement of elements to make it more intuitive for painting
     
    Last edited by a moderator: May 19, 2012
  11. MaXyM

    MaXyM Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,774
    Likes Received:
    29
    Isn't it only one side of the car? What about second one?
    Additionally such UV mapping is very hard for artist to skin, because they have to split continuous lines into various part of texture.
     
    Last edited by a moderator: May 19, 2012
  12. Vince Klortho

    Vince Klortho Registered

    Joined:
    Oct 5, 2010
    Messages:
    91
    Likes Received:
    1
    See what happens if you edit your player file and change the setting :

    "Compressed Textures" to "0".

    The game should not compress the TGA or BMP files then. I don't know for sure because I haven't tried it in years.
     
  13. Vince Klortho

    Vince Klortho Registered

    Joined:
    Oct 5, 2010
    Messages:
    91
    Likes Received:
    1
    tommy86 : try to apply a checkerboard texture to your car and see how the mapping covers the mesh. It is best not to use black and white but try other colors like red and blue (NOT your mesh's default colors) so that gaps and warping are more easily visible.

    Also - you might want to look at some skins painted for other cars to get an idea of how they were mapped. There are lots of ways to do it so it might be helpful to look at others to see what your options are.

    Best of luck with it.
     
  14. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    There's also "No compression" flag for each texture in gMotor materials. This way it's modder-controllable.

    But I guess we're allready talking ahead of what tommy86 needs right now :) Good UV mapping can require some work, but is worth the effort.
     
  15. tommy86

    tommy86 Registered

    Joined:
    Jan 10, 2012
    Messages:
    161
    Likes Received:
    4
    Thanks for advice ;) i'm using a checker map with different colours and numbers in it, are you talking about that?

    I'm trying another uv map and that's what I've done so far. on the right seems pretty good, but on the other side it's hard to mke a continous flow...any suggestion?
    View attachment 2432

    The uv map looks like that right now, but doesn't seem easy to use, or not?
    View attachment 2433

    Thanks guys ;)
     
  16. tommy86

    tommy86 Registered

    Joined:
    Jan 10, 2012
    Messages:
    161
    Likes Received:
    4
    While waiting for some help with body mapping, I proceed withe the cockpit and textured the left panel :)

    View attachment 2438

    Cheers,
    T
     
  17. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Previous UV map was better, because it was not deformed, like the new one. It only needed some final touches to it.

    But I think it's always best to unmap the car by simple flat projection done part by part.
    Something like that:

    [​IMG]

    1 - nose
    2 - "hood"
    3 - lights
    4 - side
    5 - fin (top and both sides)

    Unwrapping lights created some empty space between top view and side of the car (marked in red) - use that space for splitter, rear wing and other stuff).

    This way parts are:
    - tightly packed
    - made with flat projection (not deformed)
    - nicely alighed to each other to make painting more intuitive
     
  18. tommy86

    tommy86 Registered

    Joined:
    Jan 10, 2012
    Messages:
    161
    Likes Received:
    4
    Many thanks for explanation K (and sorry for late reply, pretty busy days..) :)

    I'll post updated UV soon ;)


    Cheers,
    T
     
  19. Vince Klortho

    Vince Klortho Registered

    Joined:
    Oct 5, 2010
    Messages:
    91
    Likes Received:
    1
    Yes, this is exactly the way to test the mapping. I realize that you are going to redo the mapping but I would like to point out a couple of things to watch for when you do this again.

    First, near the top of the first image the lines get a bit wavy. That is not a good thing and will make it difficult to paint lines, text, and logos straight there.

    Second, at the bottom of the image look at the magenta square with a 4 in it. It is not continuous and smooth between the vertical and horizontal parts. Painting that area will be very difficult and complicated. Imagine if the real car had a logo there. You would have to cut it apart to make it look smooth on the car and that is what you want to avoid.

    This is why you test the mapping like this - so you can see these kinds of things and make the car easier to paint because if a nice car is easy to paint you are likely to see more skins made for it and your painters will be happier. :)
     
  20. tommy86

    tommy86 Registered

    Joined:
    Jan 10, 2012
    Messages:
    161
    Likes Received:
    4
    I'm thinking about doing something like that :

    View attachment 2453

    cut the UV on along the lightblue line and make a continous UV along on the surface signed by the green arrows. You think this gonna be good?

    Thanks for help guys ;)
     
Thread Status:
Not open for further replies.

Share This Page