Page 1 of 1

Loading image inside shader callback

Posted: Tue Apr 05, 2011 2:11 pm
by Auradrummer
Hello guys,

Can I load an image inside shader callback, and not use a material Layer?

If yes, this can save one layer to me use the 4 layers to another thing?

I thought the following:
All my cars will have the same reflection image, so I could load it directly in the callback and use the cars material layers for another thing....

Thanks

Posted: Tue Apr 05, 2011 6:11 pm
by TCM
The shader callback is called every frame. Loading a picture (texure) takes quite a lot of time.

In a shader callback you typically do not load anything, just send data to the uniform variables.

Posted: Wed Apr 06, 2011 1:26 pm
by Auradrummer
Uhmmm.... thats make sense...

But, could I send a texture for the shader that not is attached to the object?

Like a global variable.

Thanks

Posted: Wed Apr 06, 2011 1:37 pm
by ent1ty
I don't think so

Unless you send the color of the texels as an array of floats(insane)

If you need more textures per material(up to 8), change the define in the irrlicht compile config and recompile irrlicht

Posted: Wed Apr 06, 2011 2:11 pm
by Auradrummer
AHa!

Thank you guys!