Look up the multitexture extension. Basically you bind a texture to texture unit 1 and another to texture unit 2 (you also give texture coords ofcourse). Then you render. The 2 textures will be blended together so you get the skin with some shiny additions.
You can do it manually too (2 pass algorithm):
//pass one
bind texture 1
render model
//pass 2
enable blending
offset z buffer (to prevent z-fighting)
bind texture 2
render model again
Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]
GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!
cube/environment mapping algorithm questions
hmm i see.
let me just clarify first though, just what do we mean exactly by "render"? i know it sounds stupid, but basically everytime i hear "render" i just think of the vertex declaration phase within the glBegin and glEnd statements. that''s what i''ve been thinking all along. corrections, anyone?
but anyway, for the 2-pass algorithm, i plan on implementing it myself just to be able to explain it more. so for the second pass, i just texture as normal except i enable blending and z-offset?
let me just clarify first though, just what do we mean exactly by "render"? i know it sounds stupid, but basically everytime i hear "render" i just think of the vertex declaration phase within the glBegin and glEnd statements. that''s what i''ve been thinking all along. corrections, anyone?
but anyway, for the 2-pass algorithm, i plan on implementing it myself just to be able to explain it more. so for the second pass, i just texture as normal except i enable blending and z-offset?
If you are using a polygonized scalar field you can get the normal of any vertex by simply taking the first derivative of your field at this point and nomalizing it.
Yes. Render can be a begi/end statement. It can also be calling a displaylist or calling a glDrawArrays or glDrawElements function. Basically, rendering is what puts the triangles on the screen.
In the 2 pass algo for the second pass you just bind a texture and render as normal but with bending and z-offset enabled yes. Only the texture settings are different (e.g. enviromental mapping or spheremapping or cubemapping instead of normal texturemapping).
Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]
GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!
In the 2 pass algo for the second pass you just bind a texture and render as normal but with bending and z-offset enabled yes. Only the texture settings are different (e.g. enviromental mapping or spheremapping or cubemapping instead of normal texturemapping).
Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]
GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement