Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / mipmap levels or UV co-ords problem

Author
Message
Daniel Flint
17
Years of Service
User Offline
Joined: 4th Jun 2007
Location:
Posted: 8th Dec 2008 01:59
Hi guys,

I have an intermediate texture between my walls and my ground. When the mip-map level reaches 'c' ( third level of mipmap ) the texture starts to 'bleed' over and i get a nasty dark line and a nasty white line in the wrong place. ( i believe it is an offset of UVs causing a pixel of my ground and a pixel of my wall texture to be 'wrapped' round ! )

My textures are loaded in automatically with my .X file ( and I really want to keep it this way as the rest of my workflow heavily relies on this.)

I have tried everything to turn mip-mapping off on an .x object that loads .dds textures in automatically, and no matter what i try the same happens. Is there any way round this ?

The fact of the UV co-ords being less accurate at distance is mentioned here, and I understand what is happening
http://forum.thegamecreators.com/?m=forum_view&t=80137&b=1

...but I wonder if anyone has ever counteracted the problem somehow...


Thanks for your time

Danny

Oh Crumbs!

Attachments

Login to view attachments
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 8th Dec 2008 06:31 Edited at: 8th Dec 2008 06:32
Well it's not the UV coords that are becoming less accurate(they always remain the same in this instance), it's just that as the texture size decreases(due to mip-mapping) the boundaries between pixels becomes less and less defined. Think of having a single 1024*1024 image of some painting, at mip level 0 it will look very detailed, but as you reduce its size each pixel will cover more of the image, so as in this instance they appear to bleed over what used to be your clearly defined edge. Disabling mip-maps is a solution but it will slow down rendering and generally make it look worse, a better option would be to enable Anisotropic filtering, however I don't think you can do this from DBPro directly.

So you're sure you tried Set Object Filter to disable it? If not, you resave your .dds images using some dds tool or exporter to now export any mip-maps, this should override any DBPro generation of them(I think).

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Dec 2008 12:00 Edited at: 8th Dec 2008 12:10
The problem sounds very similar to a shader problem I had recently. In my case the solution was two-fold: (1) use "clamping" rather than "wrapping" in the texture sampler; and (2) save the image in DDS format and manually alter the border colours of the various mipmaps. A bit messy but it worked.

I also tried turning off mipmapping - but, as Dark Coder suggests, while that solution removed the artefacts it may introduce other problems.

Is the problem image static or dynamic?

Edit Just had a closer look at your screenshot. Is your "intermediate" image essentially in two halves? That is, an upper light brownish section with a darker brownish one underneath representing the boundary between wall and ground? If so, then "all" you have to do is turn off wrapping for that texture.

How you achieve this depends on how the textures are applied to your object - but you might like to look at the set object texture command if a simple object is involved.

If you are using a shader then "addressU = clamp", etc, is what you need in the sampler. If it's a limb textured and rendered using DBP commands then I'm not sure what you can do - except to use a shader ( ).

Perhaps DC has further suggestions?
Daniel Flint
17
Years of Service
User Offline
Joined: 4th Jun 2007
Location:
Posted: 8th Dec 2008 12:58
Quote: "If you are using a shader then "addressU = clamp", etc, is what you need in the sampler."


GG - saved my life - again !!

Thanks so much and to you too DC as i'm sure all the other suggestions will prove useful to someone not using a shader.

Thanks

Danny

Oh Crumbs!

Login to post a reply

Server time is: 2025-05-23 08:41:16
Your offset time is: 2025-05-23 08:41:16