1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice
Like RaceDepartment on Facebook.

Saving .DDS with alpha

Discussion in 'Bob's Track Builder' started by snige, Nov 18, 2010.

  1. Hi Guys
    I wonder if someone could help me.

    I'm trying to make a wall with transparent bits to it aswell as solid. In BTB the wall looks fine, but in game (GTL) there is a black line on the edge which I can't get rid of.

    I've tried saving the .dds in both DXT3 and DXT5 with all Mipmaps using the NVIDEA plugin in Adobe CS3, but there are settings that I don't understand (like Mipmap filtering).

    GRAB.jpg
    I guess the saving of the .dds is causing the problem.

    Any ideas - help would be appreciated.
     
  2. No its not the dds, its the edge pixels.

    Use the offset function in the material editor part of the wall. You can play with scale and offset to get it to sit right.
     
  3. Ah.......brilliant! Why didn't I think of that! Thanks for the quick reply.
     
  4. Or, to get rid of these pixels forever and forget about offseting, you can leave some transparency at the bottom of the image. 2-3 pixels should be enough.
     
  5. This works well with the walls and objects, etc. But I came across this problem with transparent horizon. What should I do with that? I believe you cannot offset horizon texture same way.
     
  6. The more mip-maps - the bigger file size.
    No mips = smallest file, more than 4 = the biggest.
    Example - texture 512x512, DTX 3, alpha channel - see attached screenshot
    For bigger images the differences grow :)
     

    Attached Files:

  7. That sounds good, I try that next time. Thanks both.
     
  8. Thanks for all the input guys.
    I never realised that the edge pixels at the bottom of the image would cause this effect. I've sorted the problem now by removing (making transparent) the 4 pixels at the bottom of my image.
    TE-2 copy.jpg
    This wall is being used as an "edge of track blend", so may I ask how many mips should I save the .dds with?

    Thanks again,
    nige
     
  9. For roads and close roadsides I usually save and use 4 mips. Mostly I use some specular or bump (or both) maps (1-2 mips) - besides the effects, they seem to sharpen the view a little. I don't know how it could work with rF, but for RBR it's enough.
    The more mips you use the more calculations your machine will perform to render them.
    Edit: I don't know the difference beetwen positive and negative settings for mips - I always saw negatives. So, in xpack or while Edit Materials in btb I would use -4 for mips.
     
  10. martinez - thanks. I've been using bump and spec maps which as you say sharpen and improve the image. I suppose as always it's a trade off between performance and larger file sizes. I think the answer for me is to keep experimenting and find a balance for my particular case.
    Thanks again
     
  11. For BRB roads I use 256x256 mostly - as in original tracks. Since rF tracks are way wider, the roads there should use bigger textures, at least 512x512. For sure 1024 will work perfect. For me the size of the textures has less importance though, the more important are LOD's and the number of materials - the less materials - the better performance. That's why I prefer texture sheets - many objects on one texture = one material. You will see it soon if you like rbr ;)

    Here is how Eric Tozer helped me on bump, specular and also some discussion on texture sizes (thanks again! :))
    http://www.racedepartment.com/bobs-track-builder/32621-problem-bump-specular-etc.html
     
  12. So much to learn - so little time :wink::).
    Thanks again!
     
  13. What do you mean? Does it not work like you set number of mips that game has to render in xpack or while edit materials?
    I was saying earlier that you can set positive number (like 4) or negative (like -4) - I don't know the difference, so I ask. The "4" was only an example.
     
  14. The edge issue we see here is related to BTB walls only, it's nothing else. It's just the way BTB maps the texture to the wall. That's why the most efficient way to deal with it is to offset it, in a sense your correcting it to how it should be.
    I'm 99% sure that its offsetting the image slightly and not setting it at 0,0. The only reason why I'm 99% sure is cause i havent tested it, infact I will test it now. brb

    [ED] It is mapped to -0.0, -0.0. I don't know if that can effect anything, theoretically you could say its ok, but I have experience a lot of illogical things happen when it comes to mapping. Personally, I always would try to leave some tolerance, U,V 0.001, 0.001 is safer that 0.0, 0.0 :)
    SO I dunno, but I do know I have only seen this with BTB and not 3dmax or Blender > Simed.
     

    Attached Files:

  15. O.K. I'm out of my depth now! Well out in fact and drowning fast!:D
    Could someone please explain the difference between saving a .dds in photoshop with a certain number of mips, and changeing the MIP bias in BTB within the Edit Materials/Venue Materials/Textures tab?
    Thanks
    nige
     
  16. So, how high (or so low) the mip bias can be? I read that -4 is max. Can I treat it like percentage? Like 0 could be 0% of mips use, and -4 could be 100%? In BTB the settings seem to be unlimited - I could go over 1000 (or -1000). I think that misleaded me.
     
  17. As far as I understand it, the Mip Bias controls the distance at which the mips start being used.

    When the mip bias is 0 the full image is used up to a certain distance [I don't know the exact distance but say 20metres] and then is replaced with smaller mips in equal steps from then on.

    If you set the bias to -2 then it will hold the full image for two more steps [60m] before starting to use the mips, so making the image clearer when further away, but using more processing power.
     
  18. Yeah that makes sense to me! Not likely to be using positive bias much then!
    Thanks very much.
     
  19. The way the mips are generated is also important. Each one is a shrunken version of the main image, and of course when you shrink an image it loses detail, but there are different resize filters to mitigate that problem. Nearest Neighbour/Pixel Resize are the worst, so when you save your dds file, you have to make sure you're using a different filter.

    In Gimp you get this when you save, with Mipmap filter in the Advanced Options section:
    [​IMG]
    I tend to set the filter to 'Lanczos', which makes a hell of a difference.

    Previously I'd been using 'Nearest', because it didn't occur to me that 'Mipmap filter' meant 'how should the image be resized'.