• Advertisement

Archived

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

env map

This topic is 5494 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

how is it possible to apply env mapping to an idividual texture of a model for example a milkshape model can someone point me in the right direction thx

Share this post


Link to post
Share on other sites
Advertisement
yes it is possible if normals are sent to the pipeline. moreover, normals are the only thing you need need. After that, you have to setup automatic texture coordinate generation using GL_SPHERE_MAP and that''s all.
It seems complicated, but it''s really an easy "shader" in fact. It''s one of the easiest ever made !

Share this post


Link to post
Share on other sites
yeah i have the normals setup and env mapping setup
and i can get it to work on the whole model but i want to make it work on the crome texture and not the other textures
for example the blade of a knife and not the rest of it

Share this post


Link to post
Share on other sites
Is the blade of the knife a different texture than the rest of the models skin? Maybe if you disable GL_SPHERE_MAP for the rest of the model...¨
Hope this helps!

[edited by - James Trotter on February 8, 2003 9:46:04 AM]

Share this post


Link to post
Share on other sites
Perhaps you could use a mask texture along with the regular texture to decide which parts should be shiny or not. I know UT 2003 does this to give certain parts of objects specularity. As for actually implementing it, I have no idea

Share this post


Link to post
Share on other sites
If metal things have a different texture, then you can render the model in a second pass (set the depth test to GL_EQUAL) and in that second pass you have to override textures :
- for parts that use a metal texture, replace the texture with the env map and enable sphere map, and render the polygons associated,
- for parts that are not metallic, skip the rendering.

This should do the trick. An optimization would be to use multitexturing to skip the "multipass" concept but that''s for another day.

Share this post


Link to post
Share on other sites
Wouldnt the best way be too split the knife into 2 separate models?? 1 is the blade and the other is the rest... then just enable env mapping on the first model? should be way faster then any masking or multitexturing..

Share this post


Link to post
Share on other sites
thx for the ideas ,if anyone knows of any code examples
of this i would apreciate it as this is a lot harder than
i first thought it would be.

Share this post


Link to post
Share on other sites
How is rendered your model ? Are you using your own method or do you use an external library ?

Share this post


Link to post
Share on other sites
im using milkshape models
milkshape has a enmap feature that can apply envmapping
to an individual texture ,in milkshape you can apply more than one texture to a model so this means you can have a crome blade texture and a wooden handle texture and have the crome one envmaped and the wood one not, this is what i want to do
but in my engine

Share this post


Link to post
Share on other sites
If you can render a model with two seperate textures, then you must be switching textures at one point, right?
If so, then you just enable environment mapping when you switch to the texture you want that effect on and disable it before drawing the parts you don''t want it on.

Share this post


Link to post
Share on other sites

  • Advertisement