Sign in to follow this  
genesys

Multitexturing: some questions

Recommended Posts

I just read the NeHe tutorial about emboss bumpmapping and multitexturing. And the things explained there are actually clear so far... But i have still some questions: 1.) In the tutorial, he does only the emboss bump process using multitexturing. Combining the bump effect with the final lighting he still does using multi pass rendering (he renders the geometry a secound time using blending)... What i want to do is to create a material which supports: Diffuse Texture (this component shall be diffuse-shaded), glossy Texture (this monochrome texture shall drive glossyness of the specular highlights), emissive texture (this texture shall not be diffusely shaded and the color values shall be added to the already shaded diffuse texture) Is this even possible using multitexturing instead of multipass rendering? and if yes - how? 2.) I don't really understand why it is necessary to pass seperate texture coordinates for each texture i want to use... i think this is just an overhead since i will use the same texture coordinates for all three textures anyway... Can someone help me with these questions? Thanks!!

Share this post


Link to post
Share on other sites
I'm not sure you can do what you describe under "glossy texture" without some kind of fragment program.

The fixed pipeline texturing does not take into account specular lighting - lighting is done afterwards (I think). If you want to do something fancier, you will probably need a fragment program (or at least play around with register combiners, which is a kind of primitive somewhat awkward fragment program).

If you're sending the same texture coords into all the textures you're using, why not pre-combine them into a single texture and just use one texture unit? It would achieve the same effect.

multitexturing can achieve lots of cool stuff - notably decals and some lighting / shadow effects, but it's not a magic bullet.

Mark

Share this post


Link to post
Share on other sites
ok - let's forget about the specular stuff...

I know how to do cool effects using GLSL - but i'd like to know how to do it with multitexturing...

let's assume i only want to have a diffuse texture and an emissive texture.
I can't combine them into one texture, since the diffuse texture needs to be diffusely shaded, while the emissive texture isn't shaded and the color values are added to the shaded result.

Imagine the earth seen from space. The diffuse texture would contain the earth texture, while the emissive texture would be black with bright dots everywhere where cities are. So the lit side of the earth would look almost the same as if only the diffuse texture would be applied. But on the night side one would see the cities 'glowing'.

I know that there are many ways to do it - and using fragment programs it is really easy to do... But i'd like to get away without the need of the fragment program extension and without the expense of multip pass rendering the object.


And emissive textures / lightmaps are something which is used quite often i think...

Share this post


Link to post
Share on other sites
As far as I'm aware, you'd need to use a combiner / fragment program / some kind of shader, as the standard pipeline does not do things in the right order to achieve that effect.

Normally textures are applied, then the resulting colour value is used as input to lighting etc, which gives the final colour.

To change the order I'm pretty sure you have to do some farting around with some extensions (e.g. can't be done with fixed-function).

Someone please correct me if I'm wrong :)

Mark

Share this post


Link to post
Share on other sites
what exactly is a combiner and how does it work? in the NeHe tutorial a combiner is used - but verry basic . . . where can i learn about the posibilities using a combiner?

Share this post


Link to post
Share on other sites
if you know(and using?) GLSL so why you ask? i think you need supprot for this without shaders? if you want this so i think its useless because each graphic cars now supprots at least shader model 2, else you want to use it with 4 years? old cards.

Share this post


Link to post
Share on other sites
i want to realise it that way, so that it works on as many cards as possible... as far as i know, fragment shaders are available since openGL 2.0, while texture_env_combine is available since openGL 1.3

so i would like to do it with combiner, if it is possible... because i want it to run on older cards as well...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this