NV Register Combiners on TNT2

Can anyone give me an example how to use register register combiners on TNT2

NV_register_combiners is not available on the TNT, you’ll have to make do with ARB_texture_env_combine (or OpenGL1.3) and NV_texture_env_combine4.

Can then someone please give me an example of useing NV_texture_env_combine4. (I’ve read nVidia’s documentation but that doesn’t give me any idea how to realy use it)

Anyone? Please!

Read the spec for the extensions ARB_texture_env_combine and NV_texture_env_combine4. They provide all the information you need. Begin with ARB_texture_env_combine, and make sure you UNDERSTAND it, before moving into combine4.

I already readed those documents but they dont help me very much…

OK… to be more specific. here is what I need:

I have a terrain with 2 textures. One for flat land the other for slopes. Each vertex also has it’s color. Alpha component of color of vertex represents how much of each texture is on this vertex.

example:
0.0 - 100% texture0 + 0% texture1
0.3 - 60% texture0 + 30% texture1
1.0 - 0% texture0 + 100% texture1

Until now I have been rendering this in two passes. first draw all with texture0 and then blend texture1 where needed. Now I want to render all this in single pass with multitexturing. How do I do this?

Check out the interpolate combine mode. It does exactly this. Also see this thread on flipcode.

thanks harsman!

This is what I needed. Well almoast. Now I need just to add color to terrain.

Something like:

result = ( alpha * texture0 + (1-alpha) * texture1 ) * color

Is this possible in 1 pass?

That specific formula is not possible in one pass if you only have two combiners. It requires three, one to fetch the first texture, one to interpolate the first and second texture, and one to modulate with the color.