Glossing without fragment blend and NV_stuff
Hi...After succeding with correct ordered transparency and masked polys in 3d, I''ve get stuck on appliyng a second texture UNIT1, over the UNIT0, but partially showing UNIT1 over UNIT0 in certain parts. This is called Glossing map, but I can get the idea on how could be archieved: I''ve tryied with TEXTURE_END_MODE,GL_ADD ,GL_BLEND, an so on, but obtaining undesired results.
For example, we have a metallic shape, but corrored with stain in some areas, so the texture Unit0, should show the env brighty metal texture, while in the correred parts, will view the Unit1(the stain texture), should have a 2 pass, with some kind of masking? any ideas people, any paper, any tutorial??????
Thanks in advance!
Yep ;)
yep, quite interesting using a single texture unit(the default) and masking each other in two geometry passes, but surely this couldn''t be done using 2 texture units(since TNT2) , cause there too little blend and function operators, on texture per texture working.
Then you can''t mask one texture unit each other in a single geometry pass????
Then you can''t mask one texture unit each other in a single geometry pass????
Yep ;)
I guess if someone managed to make "masking stuff" using the 2 texture units(and maybe a final pass).
I meant by "masking stuff" those to achieve effects such as: bump gloss, phong gloss, ...
I meant by "masking stuff" those to achieve effects such as: bump gloss, phong gloss, ...
Yep ;)
You can use alpha chanel of texture on unit 0 to represent "glossines" of material. Then use tex_env_combine and inperpolate RGB of textures on units 0 and 1 with alpha form tex0. This works even on TNT.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
Perfectly understood adding the Alpha component to the Unit0, to gain advantage on posterior ops. but still getting stuck on that "interpolate unit0(RGB) unit1(RGB) with unit0(Alpha)"
Can you show me some papers or tuts on this, plez?
danke
Can you show me some papers or tuts on this, plez?
danke
Yep ;)
Register combiners''s ops beetwen the unit0 and unit1 are too hard,how to interpolate R0G0B0 R1G1B1 using A0 ?¿thus the need of papers of something explanatory, then I can know what I''m doing
Yep ;)
You can use this extension:
http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_env_combine.txt
You need something like
final_color = tex0.rgb * tex0.a + tex1.rgb * (1-tex0.a)
For some more information use documentation on nVidia dev-pages
If you still have problems I''ll write you some sample code.
You should never let your fears become the boundaries of your dreams.
http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_env_combine.txt
You need something like
final_color = tex0.rgb * tex0.a + tex1.rgb * (1-tex0.a)
For some more information use documentation on nVidia dev-pages
If you still have problems I''ll write you some sample code.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
yes, surely a drop of lines should be selfexplanatory, but...have you decided to made a fast tutorial, or a html document explaining the basis and management of texture unit operators(blend,add,mask,substract) surely one man can find out one or two, but roughly all if they don''t know what have in hands. Nvidia stuff, seems to be not so bad, but still leak of clarity, you can spread a ray of light if yo''ve time
Thanxs

Thanxs
Yep ;)
Hi. I don't have time to write a tutorial but here is some sample code (sorry for any typos):
You should never let your fears become the boundaries of your dreams.
[edited by - _DarkWIng_ on December 30, 2003 11:12:25 AM]
// select texture unit 0 and bind base texture (RGB)// ...// just replace anything with this textureglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );// select texture unit 1 and bind 2nd texture (RGBA)// ...// select tex_env_combine extensionglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB );// select interpolation mode of this extension// result = arg0 * arg2 + arg1 * (1-arg2)glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_INTERPOLATE_ARB ); // select arg0 = previous texture (unit0) RGBglTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS_ARB );glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR );// select arg1 = this texture (unit1) RGBglTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE );glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR );// select arg2 = this texture (unit1) alphaglTexEnvi( GL_TEXTURE_ENV, GL_SOURCE2_RGB_ARB, GL_TEXTURE );glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND2_RGB_ARB, GL_SRC_ALPHA );// draw your stuff here// ...// after this remember do disable all this (unused texture units, tex_envs,...)
You should never let your fears become the boundaries of your dreams.
[edited by - _DarkWIng_ on December 30, 2003 11:12:25 AM]
You should never let your fears become the boundaries of your dreams.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement