Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Texture Stages & Shaders

Author
Message
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 2nd Oct 2009 16:27 Edited at: 2nd Oct 2009 17:34
How can I tell my shader which texture stage to use for a certain texture sampler?
Let's say I have 'dirt.png' as texture stage 0 set in my app ( dbTextureObject( id, stage, image ) ),
and 'normal.png' ( a normal map ) as stage 1.
This is the part of my shader that loads the textures:



Is there some kind of semantic to reference to a certain texture stage, or how is this done?

EDIT: Right now, the shader uses the second texture ( the normal map in stage 1 )
for both the diffuse-texture and as normal map!

They say it's better to burn out, than it is to fade away...
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 3rd Oct 2009 15:25
Bump.
Anyone has a hint on this?
It's kind of fundamental for effectivly using custom shaders in your DGDK-app...

They say it's better to burn out, than it is to fade away...
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 3rd Oct 2009 15:52
Texture stage 0 = 'texture ModelTexture', 1 = 'texture NormalMap', thus in declaration order. The samplers have nothing to do with this, instead they specify what texture they refer to, as seen here: 'Texture = (ModelTexture);'. Though if you wish to change this order I'm pretty sure you can override it in the technique, but I've never tried this so no idea, look HERE.

_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 3rd Oct 2009 16:23 Edited at: 3rd Oct 2009 16:24
Ok, so the stages are loaded in order. Works fine now, thanks!

EDIT: btw there is a maximum of 4 texture stages, right? ( stage 0 - 3 )

They say it's better to burn out, than it is to fade away...
Serial Velocity
16
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 3rd Oct 2009 16:48
Theres a maximum of 8 texture stages AFAIK (Stage 0-7)

Login to post a reply

Server time is: 2024-10-01 14:34:04
Your offset time is: 2024-10-01 14:34:04