Archived

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

Wavewash

Texture Blending Method

Recommended Posts

I'm using a texture blending method where I render the triangles multiple times in the video buffer before I display it. What I do is I render my terrain once with teh base texture then again with a rock, mud, or whatever second texture. But the second time I render I have alpha blending on. The alpha values are taken from a alphamap (a black and white bitmap) which tells how transparent the vertex should be. So the entire terrain is rendered twice. What I would like to discuss is how effective is this technique. From a visual stand point I would say it is very effective. Here's a pic of my terrain engine: Now from my standpoint I beleive this to be a great techniqe for rendering my terrain because it's not continous. I don't have to worry about rendering triangles way off into the distance being only an island. What do you guys think of this technique? I got this techniqe from an article written by charles bloom. He refers to it as "spattering" http://cbloom.com/3d/techdocs/splatting.txt Edited by - wavewash on January 13, 2002 12:34:53 AM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Nice!!!
The result looks very good...
Though, you need to render twice... which could mean divides the performance by 2. And you might need more rendering pass if you want to have other special effect...
Might be worth it though...

Share this post


Link to post
Share on other sites
I was thinking that also that rendering twice effectivly means that it''s my proformance/2. But the thing that makes me unsure about that is that I never update the vertex buffer again. So I''m using the same vertex buffer for both passes. In the article the author discribes this as the sort of technique that usually unrealistic in games and also what gives the geforce those crazy triangle rendering numbers from.
So this actually might be effective to a certain degree.
Anyone know about the proformance hit this gives?
~wave

Share this post


Link to post
Share on other sites
That''s the same thing I''m doing, except I use per-vertex transparency which is determined by altitude. Essentially the same thing though. I''m also of course open to the mask idea that you use. I looked at the single pass multitexturing extensions but couldn''t think of a way to apply them. If anyone has any information for Wavewash, I''d be glad to hear it to.

Share this post


Link to post
Share on other sites
TerranFury: I am doing the exact same thing as you actually, Per vertex transparency. But I don''t get the transparency value from the altitude but from a bitmap file which tells the vert how transparent it should be.

So I set the vert transparency as follows:

d3dcolor(shade,shade,shade,(float)(bitmap.buffer[y*256+x]/255));

So there is no masking at all. I just read in the values from a bitmap file.

As for the speed question I don''t think it gets hit that hard. Here''s a quote from the splatting article:

"it runs very fast on modern hardware, even though individual terrain tiles may be rendered many times, because VB''s are never touched and the same VB is rendered with repeatedly. In fact, this is kind of the ideal "unrealistic" scenario in which GeForces benchmark so well : rendering the same model over and over. It''s quite easy to approach theoretical triangle rates on GeForce2 with splatting. In practice, I found my renderer to be fill-rate limited on GeForce2 GTS."

~Charles Bloom in his spatting article


So according to Charles Bloom we should be actually rendering quite quickly since this method is more limited by the fillrate then anything else. Also if we are programming for current and future hardware this should be fine. He explains later in the article that this method becomes a problem when you try rendering on older hardware such as rage128 and such.

As for multi-texturning, from what I understand we would have to create a mask texture and then use that. Which I am totally unsure about. I mean I could think that if I take my alpha map that I am using to get teh vert transparency, stretch it over the terrain then use tri-linear filtering on it to smooth it out and use that for the multi texturing. Seems a little too complicated and I have a feeling that all the state changes that would be needed for it would be pretty slow also. If it was a viable way to approach terrain texture blending then I think we would see it more in games.

~Wave

Share this post


Link to post
Share on other sites
Okay I was doing some benchmarking on my terrain engine and it seems that it''s TOTALLY capped by the fillrate. My machine is a 800mhz with a voodoo5500 and the framerate seems to be capped at 20-25fps. No matter what the resolution. I''ve taken the program from 640x480 to 1024x768 and had no proformance increase more then 1 or 2 frames.
Anyone have an explanation for this? I''m pointing my finger at my cards fillrate as the culprit.
~Wave

Share this post


Link to post
Share on other sites
I think I have confirmed that it is fillrate. When I tried the program on my other computer which has a geforce 2 mx 400 coupled with a 1.4 ghz cpu on it, the fps skyrocketed to 65.75 fps. So I'm pretty sure that's the frame rate is directly related to the fillrate capabilities of the card.
~Wave

Edited by - wavewash on January 16, 2002 1:27:53 AM

Share this post


Link to post
Share on other sites
I apologize for keeping this thread going for so long, but I feel that I have to update this one more time just to fill in what happened with my engine so in the future if anyone searches through the forums they don''t get left dangling by this thread.

The terrain engine wasn''t being capped by fillrate because I wasn''t drawing enough things on the screen for that to be the case. The problem is that my video card (voodoo5500) doesn''t support hardware transform and lighting. So all of that was done off the car, and because of my multipass rendering technique I was drawing the triangles twice. So I was transforming twice the triangles I needed to.

So to reduce that I set up a texture cascade to use multitexturing. So I could get multiple textures in one pass. This increased my 20fps to 35 fps... which is okay by me. With some frustrum culling. I''m sure that this number will go even higher. Though I have backface culling on the traingles that are culled still have to be transformed taking time.

Much thanks to Kiwidog, Smoogle, Mith, and mrfun. for the great help.

~Wave

Share this post


Link to post
Share on other sites