[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11599] branches/soc-2007-maike/source/ blender: Added needed program param to uniform functions
Miguel Torres Lima
torreslima at gmail.com
Tue Aug 14 18:46:07 CEST 2007
Revision: 11599
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11599
Author: maike
Date: 2007-08-14 18:46:07 +0200 (Tue, 14 Aug 2007)
Log Message:
-----------
Added needed program param to uniform functions
Modified Paths:
--------------
branches/soc-2007-maike/source/blender/include/BIF_glsl_uniforms.h
branches/soc-2007-maike/source/blender/src/glsl_uniforms.c
Modified: branches/soc-2007-maike/source/blender/include/BIF_glsl_uniforms.h
===================================================================
--- branches/soc-2007-maike/source/blender/include/BIF_glsl_uniforms.h 2007-08-14 16:12:57 UTC (rev 11598)
+++ branches/soc-2007-maike/source/blender/include/BIF_glsl_uniforms.h 2007-08-14 16:46:07 UTC (rev 11599)
@@ -69,21 +69,36 @@
void glsl_update_texture_uniforms(unsigned int program, struct MTex *mtex, int texindex, int matindex);
#endif
-void glsl_update_texture_clouds_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_wood_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_marble_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_magic_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_blend_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_stucci_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_noise_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_image_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_plugin_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_envmap_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_musgrave_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_voronoi_uniforms(struct Tex *tex, int texindex, int matindex);
-void glsl_update_texture_distnoise_uniforms(struct Tex *tex, int texindex, int matindex);
+#ifdef __APPLE__
+void glsl_update_texture_clouds_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_wood_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_marble_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_magic_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_blend_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_stucci_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_noise_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_image_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_plugin_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_envmap_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_musgrave_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_voronoi_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_distnoise_uniforms(unsigned long program, struct Tex *tex, int texindex, int matindex);
+#else
+void glsl_update_texture_clouds_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_wood_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_marble_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_magic_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_blend_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_stucci_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_noise_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_image_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_plugin_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_envmap_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_musgrave_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_voronoi_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+void glsl_update_texture_distnoise_uniforms(unsigned int program, struct Tex *tex, int texindex, int matindex);
+#endif
-
/* -------------------------------------- LIGHT -------------------------------------- */
void glsl_update_all_light_uniforms(struct GLSL_MaterialTree_ *tree);
Modified: branches/soc-2007-maike/source/blender/src/glsl_uniforms.c
===================================================================
--- branches/soc-2007-maike/source/blender/src/glsl_uniforms.c 2007-08-14 16:12:57 UTC (rev 11598)
+++ branches/soc-2007-maike/source/blender/src/glsl_uniforms.c 2007-08-14 16:46:07 UTC (rev 11599)
@@ -554,43 +554,43 @@
switch(tex->type)
{
case TEX_CLOUDS:
- glsl_update_texture_clouds_uniforms(tex, texindex, matindex);
+ glsl_update_texture_clouds_uniforms(program, tex, texindex, matindex);
break;
case TEX_WOOD:
- glsl_update_texture_wood_uniforms(tex, texindex, matindex);
+ glsl_update_texture_wood_uniforms(program, tex, texindex, matindex);
break;
case TEX_MARBLE:
- glsl_update_texture_marble_uniforms(tex, texindex, matindex);
+ glsl_update_texture_marble_uniforms(program, tex, texindex, matindex);
break;
case TEX_MAGIC:
- glsl_update_texture_magic_uniforms(tex, texindex, matindex);
+ glsl_update_texture_magic_uniforms(program, tex, texindex, matindex);
break;
case TEX_BLEND:
- glsl_update_texture_blend_uniforms(tex, texindex, matindex);
+ glsl_update_texture_blend_uniforms(program, tex, texindex, matindex);
break;
case TEX_STUCCI:
- glsl_update_texture_stucci_uniforms(tex, texindex, matindex);
+ glsl_update_texture_stucci_uniforms(program, tex, texindex, matindex);
break;
case TEX_NOISE:
- glsl_update_texture_noise_uniforms(tex, texindex, matindex);
+ glsl_update_texture_noise_uniforms(program, tex, texindex, matindex);
break;
case TEX_IMAGE:
- glsl_update_texture_image_uniforms(tex, texindex, matindex);
+ glsl_update_texture_image_uniforms(program, tex, texindex, matindex);
break;
case TEX_PLUGIN:
- glsl_update_texture_plugin_uniforms(tex, texindex, matindex);
+ glsl_update_texture_plugin_uniforms(program, tex, texindex, matindex);
break;
case TEX_ENVMAP:
- glsl_update_texture_envmap_uniforms(tex, texindex, matindex);
+ glsl_update_texture_envmap_uniforms(program, tex, texindex, matindex);
break;
case TEX_MUSGRAVE:
- glsl_update_texture_musgrave_uniforms(tex, texindex, matindex);
+ glsl_update_texture_musgrave_uniforms(program, tex, texindex, matindex);
break;
case TEX_VORONOI:
- glsl_update_texture_voronoi_uniforms(tex, texindex, matindex);
+ glsl_update_texture_voronoi_uniforms(program, tex, texindex, matindex);
break;
case TEX_DISTNOISE:
- glsl_update_texture_distnoise_uniforms(tex, texindex, matindex);
+ glsl_update_texture_distnoise_uniforms(program, tex, texindex, matindex);
break;
}
@@ -610,79 +610,95 @@
}
-void glsl_update_texture_clouds_uniforms(Tex *tex, int texindex, int matindex)
+void glsl_update_texture_clouds_uniforms(GLuint program, Tex *tex, int texindex, int matindex)
{
}
-void glsl_update_texture_wood_uniforms(Tex *tex, int texindex, int matindex)
+void glsl_update_texture_wood_uniforms(GLuint program, Tex *tex, int texindex, int matindex)
{
}
-void glsl_update_texture_marble_uniforms(Tex *tex, int texindex, int matindex)
+void glsl_update_texture_marble_uniforms(GLuint program, Tex *tex, int texindex, int matindex)
{
}
-void glsl_update_texture_magic_uniforms(Tex *tex, int texindex, int matindex)
+void glsl_update_texture_magic_uniforms(GLuint program, Tex *tex, int texindex, int matindex)
{
+ char *color = glsl_string(5, 0, "mat_", GINT, matindex, 0, "_tex_", GINT, texindex, 0, "_color");
+ char *depth = glsl_string(5, 0, "mat_", GINT, matindex, 0, "_tex_", GINT, texindex, 0, "_depth");
+ char *turbulence = glsl_string(5, 0, "mat_", GINT, matindex, 0, "_tex_", GINT, texindex, 0, "_turbulence");
+ char *contrast = glsl_string(5, 0, "mat_", GINT, matindex, 0, "_tex_", GINT, texindex, 0, "_contrast");
+ char *brightness = glsl_string(5, 0, "mat_", GINT, matindex, 0, "_tex_", GINT, texindex, 0, "_brightness");
+ glUniform3f(glsl_uniform_location(program, color), tex->rfac, tex->gfac, tex->bfac);
+ glUniform1f(glsl_uniform_location(program, depth), tex->noisedepth);
+ glUniform1f(glsl_uniform_location(program, turbulence), tex->turbul);
+ glUniform1f(glsl_uniform_location(program, contrast), tex->contrast);
+ glUniform1f(glsl_uniform_location(program, brightness), tex->bright);
+
+ MEM_freeN(color);
+ MEM_freeN(depth);
+ MEM_freeN(turbulence);
+ MEM_freeN(contrast);
+ MEM_freeN(brightness);
}
-void glsl_update_texture_blend_uniforms(Tex *tex, int texindex, int matindex)
+void glsl_update_texture_blend_uniforms(GLuint program, Tex *tex, int texindex, int matindex)
{
}
-void glsl_update_texture_stucci_uniforms(Tex *tex, int texindex, int matindex)
+void glsl_update_texture_stucci_uniforms(GLuint program, Tex *tex, int texindex, int matindex)
{
}
-void glsl_update_texture_noise_uniforms(Tex *tex, int texindex, int matindex)
+void glsl_update_texture_noise_uniforms(GLuint program, Tex *tex, int texindex, int matindex)
{
}
-void glsl_update_texture_image_uniforms(Tex *tex, int texindex, int matindex)
+void glsl_update_texture_image_uniforms(GLuint program, Tex *tex, int texindex, int matindex)
{
}
-void glsl_update_texture_plugin_uniforms(Tex *tex, int texindex, int matindex)
+void glsl_update_texture_plugin_uniforms(GLuint program, Tex *tex, int texindex, int matindex)
{
}
-void glsl_update_texture_envmap_uniforms(Tex *tex, int texindex, int matindex)
+void glsl_update_texture_envmap_uniforms(GLuint program, Tex *tex, int texindex, int matindex)
{
}
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list