Jump to content
  • Advertisement
Sign in to follow this  

multitexture, know a good way to do this Effect?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I understand how to get the multitexture extension added and im pretty sure I understand how to use the combine functions I dont see a way to do the the effect i want tho perhaps someone can advise? heres the plan: terrain is initally white, with color/shading - ordinary nontextured stuff tex unit 0 uses slope / altitude as tex coords and has colors along with an alpha channel its basically acting as a lookup table, to determine what portions of landscape should have what material/color on them based on their slope and height tex unit 1 is a detail texture, say grass, uses normal X/Y tex coords first tex u0 shoudl be drawn on the terrain, probably using replace then tex u0 and tex u1 should interpolate, using tex u0's alpha as arg2 so the detail tex ends up showing thru the color table in given regions, say on the non-sloped areas, since its grass then the result of tex 0interp1 shoudl be modulated with the terrain primary colors so they both get shading on them thats basically what i want but the ordering is contrary to the pipeline the first available combination is between primary color and tu0, then between tu0 and tu1 my approach is the exact opposite ordering so how do i do it? i really dont want to do a second pass with blending.... I cannot use a texture to determine the shading(lightmap) my terrain is procedural(infinite size) at runtime, thus it must use the automatic vertex color/shading for the same reason, id like to avoid using color changes per vertex thus my use of tu0 as a slope/altitude color table, rather than specifying per vertex as CPU load ps, i only have 2 texture units, old card [Edited by - haphazardlynamed on August 28, 2004 12:12:14 AM]

Share this post

Link to post
Share on other sites
second pass means twice the rendering time
always to be avoided if possible

yes, it seems to me as well, that a second pass to get the shading data in front is the only way

i'm hoping that someone here more experienced might have a few tricks up their sleeve tho

Share this post

Link to post
Share on other sites
just did a test using a 2 pass approach

it sucked; too slow
didnt look too nice either, blending the textured terrain with the gray shaded terrain -> too pale

i guess the root of the problem is that using up one of the texture units for my color table/detail mask really limits everything else

i might give up and go with a regular approach soon:
precompute vertex colors to define detailmap alpha masks(but vertex colors are ugly and blocky)
tu0 to hold detail tex
tu1 to hold precomputed lightmap
(that is the norm, right?)

that really sound like it might suck for my infinite procedural terrain tho
im going to have to build better caching stuff to hold the precomputed alpha and lightmaps, minimize the frequiency of generating them, have to do it in batches on the fly....ugh, poor CPU..

well, it is a weekend... maybe wait a day and see if anyone has any better ideas...

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!