[Soc-2010-dev] Shaders Week 2 Report

Konrad Wilhelm Kleine konrad at konradwilhelm.de
Sun Jun 6 17:54:44 CEST 2010


Hey Mitchell,

You did some great work here!

I recently did some experiments with GLSL and was very confused when it
comes to passing textures to my shaders. To clarify: If you support
"int" or "uint" (don't know which one it is), you already have support
to pass textures as "sampler2D".

These are the steps:

0) Set "i" to 0
1) Get uniform location of your sampler2D (this isn't the textureID NOR
the texture unit)
2) Set your uniform using "glUniformXY(location, i);"
3) Activate your texture using "glActiveTexture(GL_TEXTURE0 + i);"
4) Bind your texture using "glBindTexture(GL_TEXTURE_2D, textureID);"
5) Increment i
6) Repeat steps 1) to 5) for every texture you have

This website helped me a lot:
http://www.opengl.org/wiki/GLSL_:_common_mistakes#Binding_A_Texture

Cheers,
kwk

Am 05.06.2010 02:37, schrieb Mitchell Stokes:
> Here is my report for week 2:
> 
> http://mogurijin.wordpress.com/2010/06/04/gsoc-status-report-week-2/
> 
> Cheers,
> Mitchell Stokes (Moguri)
> 
> 
> 
> _______________________________________________
> Soc-2010-dev mailing list
> Soc-2010-dev at blender.org
> http://lists.blender.org/mailman/listinfo/soc-2010-dev


More information about the Soc-2010-dev mailing list