#### Archived

This topic is now archived and is closed to further replies.

# Detail Noise w/Multitexturing Distance/Density

This topic is 5957 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Working on a terrain engine and I''ve (at least for now) decided upon texturing by using a single texture that covers literrally 10s of 1000s of feet to provide basically a patch of color on the terrain. I then add a noise texture to the 2nd stage and modulate them. I''m happy with the effect of this, but I have a problem that I cannot seem to solve. This is a screen shot showing the problem. You can see that the ''pixels'' of the noise bitmap are the same size throughout the scene and so terrain close to the camera is pixelated and terrain far from the camera is too finely detailed (really, really far terrain looks much worse). Here is the same screen shot but this time it appears I solved the problem. This is much nicer and is exactly what i''m looking for. The problem is that when you move the camera, the detail pixels ''swim'' all over the place, they are not ''affixed'' to the ground. for the 1st shot, the algorithm for calculating the tex coords on the detail texture is: pv->tu2 = txc * DETAILFACTOR; pv->tv2 = tzc * DETAILFACTOR; where pv points to the vertex struct, txc/tzc are the world coordinates of the vertex, and DETAILFACTOR is an arbitrary number. Increasing DETAILFACTOR makes the detail pixels smaller, but of course it''s uniform across the landscape. for the 2nd shot: pv->tu2 = txc * DETAILFACTOR / dist * ARBFACTOR; pv->tv2 = tzc * DETAILFACTOR / dist * ARBFACTOR; where dist is the distance between the the camera and the vertex and ARBFACTOR is another arbitrary value. Before I even tried the above I actually thought out loud to myself that that was going to make the pixels ''swim''. Problem is, I have no idea why I thought that or how to solve this. I''ve been wracking my poor brain for hours, so any clues, hints, or advice will be welcome. _____________________________________________ Come join us on IRC in #directxdev @ irc.afternet.org

##### Share on other sites
Maybe you could alpha blend the detail texture to appear less strongly as the distance increases. I don''t know how fast alpha blending is.

Proceeding on a brutal rampage is the obvious choice.

##### Share on other sites
I don''t know how to "alpha blend the detail texture". I''ve read the docs and I understand "add the components of the arguments", I understand what the select arg''s do, but I don''t understand the conceptual result of what each operation does or what a given operation will net me.

Can you elaborate a bit more?

_____________________________________________

##### Share on other sites
I don''t think that what you are trying to do is actually possible without the ''swimming'' effect. For example, take a point in the distance which has an overall light green coloured pixel (or in fact any colour). When you get up very close to that point, your algorithm will have replaced that with your detail texture. Unfortunately though, your detail texture is not an approximation of the colour of that pixel. So as you move around and you are reassigning the detail texture, you are always going to see the swimming effect.

Apart from this, I think that you are pretty much always going to get the "big pixel" problem. Though there are a couple of things you could do to reduce this effect. You could first use mip-mapping and make the detail textures in the foreground very high resolution, and those further away at the current level of detail you have. I would also suggest using bilinear filtering to get rid off the horrible pixelated look.

Rory.

##### Share on other sites
I''ve been looking at the MMORPG Dark Age of Camelot (among many others) for ''inspiration''. In fact, the noise bitmap I''m using I took right out of the game''s file directory.

After looking more closely at their terrain, I noticed that their detail pixels do indeed get smaller. However, their pixels don''t seem as stark as mine, they are more ''fuzzy''. I this because:

1) They are doing additional blending? (they do seem to be using lightmaps on the terrain for day/night transitions, would that ''fuzz'' the detail pixels?)
2) They limit the camera''s movement and view volume so that the effect is less noticable. I want to display more terrain so maybe I have to scrap this and go to a tiled scheme? (yuk!)

_____________________________________________

##### Share on other sites
quote:
Original post by ProtoPornoPants
Apart from this, I think that you are pretty much always going to get the "big pixel" problem. Though there are a couple of things you could do to reduce this effect. You could first use mip-mapping and make the detail textures in the foreground very high resolution, and those further away at the current level of detail you have. I would also suggest using bilinear filtering to get rid off the horrible pixelated look.

I turned on bilinear filtering for the detail texture stage and between that and tweeking the DETAILFACTOR I I have a result I''m pretty happy with

_____________________________________________

##### Share on other sites
I''m too late but I''ll post what I would have posted before :-). You have to look into texture filtering. The method you''re using is point filtering it basically it takes the nearest point on the texture for rendering. This creates blocky results and is easily visible when viewing objects closly in DOOM for example. Bilinear filtering produces decent results with minimal cost. Trilinear filtering also is nice. Both linear methods nicely blend the textures across an object but will create a blur effect. Anistropic filtering is supposed to decrease the distortion in objects but I personally don''t find it that much better.

Finally, if you really want to get cool filtering results, you have to give up hardware acceleration. Many API''s don''t support this yet so a software rendering engine is needed. The results I''m talking about are at Smart Texture Filtering. It''s a pretty neat concept. Check it out if you can.

---
My Site

##### Share on other sites
I read that article on smart filtering, pretty cool, but I don''t think it applies to adding noise.

As for lack of hardware support I''m a firm advocate of moving forward, and not lingering in the past. Besides, by the time I ever produce anything that another person will get their hands on, the GF4 will be obsolete.

_____________________________________________

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633330
• Total Posts
3011388
• ### Who's Online (See full list)

There are no registered users currently online

×