[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15672] branches/apricot/source/blender/ gpu/intern: Apricot Branch

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Jul 21 17:53:53 CEST 2008


Revision: 15672
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15672
Author:   blendix
Date:     2008-07-21 17:53:53 +0200 (Mon, 21 Jul 2008)

Log Message:
-----------
Apricot Branch
==============

* Fix for crashes in last commit.
* Added "Refl" map input for textures.

Modified Paths:
--------------
    branches/apricot/source/blender/gpu/intern/gpu_draw.c
    branches/apricot/source/blender/gpu/intern/gpu_material.c
    branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl
    branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c

Modified: branches/apricot/source/blender/gpu/intern/gpu_draw.c
===================================================================
--- branches/apricot/source/blender/gpu/intern/gpu_draw.c	2008-07-21 15:35:11 UTC (rev 15671)
+++ branches/apricot/source/blender/gpu/intern/gpu_draw.c	2008-07-21 15:53:53 UTC (rev 15672)
@@ -368,12 +368,6 @@
 		glMatrixMode(GL_MODELVIEW);
 	}
 
-	/* setting current tile according to frame */
-	if(ima->tpageflag & IMA_TWINANIM)
-		GTS.curtile= ima->lastframe;
-	else
-		GTS.curtile= tface->tile;
-
 	return 1;
 }
 
@@ -417,6 +411,12 @@
 	if ((ibuf->rect==NULL) && ibuf->rect_float)
 		IMB_rect_from_float(ibuf);
 
+	/* setting current tile according to frame */
+	if(ima->tpageflag & IMA_TWINANIM)
+		GTS.curtile= ima->lastframe;
+	else
+		GTS.curtile= tface->tile;
+
 	if(GTS.tilemode) {
 		/* tiled mode */
 		if(ima->repbind==0) gpu_make_repbind(ima);

Modified: branches/apricot/source/blender/gpu/intern/gpu_material.c
===================================================================
--- branches/apricot/source/blender/gpu/intern/gpu_material.c	2008-07-21 15:35:11 UTC (rev 15671)
+++ branches/apricot/source/blender/gpu/intern/gpu_material.c	2008-07-21 15:53:53 UTC (rev 15672)
@@ -823,6 +823,8 @@
 				texco= texco_object;
 			else if(mtex->texco==TEXCO_GLOB)
 				texco= texco_global;
+			else if(mtex->texco==TEXCO_REFL)
+				texco= shi->ref;
 			else if(mtex->texco==TEXCO_UV) {
 				if(1) { //!(texco_uv && strcmp(mtex->uvname, lastuvname) == 0)) {
 					GPU_link(mat, "texco_uv", GPU_attribute(CD_MTFACE, mtex->uvname), &texco_uv);
@@ -923,6 +925,7 @@
 				}
 
 				GPU_link(mat, "vec_math_negate", shi->vn, &orn);
+				GPU_link(mat, "texco_refl", shi->vn, shi->view, &shi->ref);
 			}
 
 			if((mtex->mapto & MAP_VARS)) {
@@ -994,6 +997,7 @@
 	GPU_link(mat, "set_value", GPU_uniform(&ma->amb), &shi->amb);
 	GPU_link(mat, "shade_view", GPU_builtin(GPU_VIEW_POSITION), &shi->view);
 	GPU_link(mat, "vcol_attribute", GPU_attribute(CD_MCOL, ""), &shi->vcol);
+	GPU_link(mat, "texco_refl", shi->vn, shi->view, &shi->ref);
 }
 
 void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)

Modified: branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl
===================================================================
--- branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl	2008-07-21 15:35:11 UTC (rev 15671)
+++ branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl	2008-07-21 15:53:53 UTC (rev 15672)
@@ -684,6 +684,11 @@
 	object = (obinvmat*(viewinvmat*vec4(co, 1.0))).xyz;
 }
 
+void texco_refl(vec3 vn, vec3 view, out vec3 ref)
+{
+	ref = view - 2.0*dot(vn, view)*vn;
+}
+
 void shade_norm(vec3 normal, out vec3 outnormal)
 {
 	/* blender render normal is negated */

Modified: branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c
===================================================================
--- branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c	2008-07-21 15:35:11 UTC (rev 15671)
+++ branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c	2008-07-21 15:53:53 UTC (rev 15672)
@@ -1,437 +1,439 @@
 /* DataToC output of file <gpu_shader_material_glsl> */
 
-int datatoc_gpu_shader_material_glsl_size= 31490;
+int datatoc_gpu_shader_material_glsl_size= 31581;
 char datatoc_gpu_shader_material_glsl[]= {
- 10,102,
-108,111, 97,116, 32,101,120,112, 95, 98,108,101,110,100,101,114, 40,102,108,111, 97,116, 32,102, 41, 10,123, 10,  9,114,101,116,
-117,114,110, 32,112,111,119, 40, 50, 46, 55, 49, 56, 50, 56, 49, 56, 50, 56, 52, 54, 44, 32,102, 41, 59, 10,125, 10, 10,118,111,
-105,100, 32,114,103, 98, 95,116,111, 95,104,115,118, 40,118,101, 99, 52, 32,114,103, 98, 44, 32,111,117,116, 32,118,101, 99, 52,
- 32,111,117,116, 99,111,108, 41, 10,123, 10,  9,102,108,111, 97,116, 32, 99,109, 97,120, 44, 32, 99,109,105,110, 44, 32,104, 44,
- 32,115, 44, 32,118, 44, 32, 99,100,101,108,116, 97, 59, 10,  9,118,101, 99, 51, 32, 99, 59, 10, 10,  9, 99,109, 97,120, 32, 61,
- 32,109, 97,120, 40,114,103, 98, 91, 48, 93, 44, 32,109, 97,120, 40,114,103, 98, 91, 49, 93, 44, 32,114,103, 98, 91, 50, 93, 41,
- 41, 59, 10,  9, 99,109,105,110, 32, 61, 32,109,105,110, 40,114,103, 98, 91, 48, 93, 44, 32,109,105,110, 40,114,103, 98, 91, 49,
- 93, 44, 32,114,103, 98, 91, 50, 93, 41, 41, 59, 10,  9, 99,100,101,108,116, 97, 32, 61, 32, 99,109, 97,120, 45, 99,109,105,110,
- 59, 10, 10,  9,118, 32, 61, 32, 99,109, 97,120, 59, 10,  9,105,102, 32, 40, 99,109, 97,120, 33, 61, 48, 46, 48, 41, 10,  9,  9,
-115, 32, 61, 32, 99,100,101,108,116, 97, 47, 99,109, 97,120, 59, 10,  9,101,108,115,101, 32,123, 10,  9,  9,115, 32, 61, 32, 48,
- 46, 48, 59, 10,  9,  9,104, 32, 61, 32, 48, 46, 48, 59, 10,  9,125, 10, 10,  9,105,102, 32, 40,115, 32, 61, 61, 32, 48, 46, 48,
- 41, 32,123, 10,  9,  9,104, 32, 61, 32, 48, 46, 48, 59, 10,  9,125, 10,  9,101,108,115,101, 32,123, 10,  9,  9, 99, 32, 61, 32,
- 40,118,101, 99, 51, 40, 99,109, 97,120, 44, 32, 99,109, 97,120, 44, 32, 99,109, 97,120, 41, 32, 45, 32,114,103, 98, 46,120,121,
-122, 41, 47, 99,100,101,108,116, 97, 59, 10, 10,  9,  9,105,102, 32, 40,114,103, 98, 46,120, 61, 61, 99,109, 97,120, 41, 32,104,
- 32, 61, 32, 99, 91, 50, 93, 32, 45, 32, 99, 91, 49, 93, 59, 10,  9,  9,101,108,115,101, 32,105,102, 32, 40,114,103, 98, 46,121,
- 61, 61, 99,109, 97,120, 41, 32,104, 32, 61, 32, 50, 46, 48, 32, 43, 32, 99, 91, 48, 93, 32, 45, 32, 32, 99, 91, 50, 93, 59, 10,
-  9,  9,101,108,115,101, 32,104, 32, 61, 32, 52, 46, 48, 32, 43, 32, 99, 91, 49, 93, 32, 45, 32, 99, 91, 48, 93, 59, 10, 10,  9,
-  9,104, 32, 47, 61, 32, 54, 46, 48, 59, 10, 10,  9,  9,105,102, 32, 40,104, 60, 48, 46, 48, 41, 10,  9,  9,  9,104, 32, 43, 61,
- 32, 49, 46, 48, 59, 10,  9,125, 10, 10,  9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,104, 44, 32,115, 44, 32,118,
- 44, 32,114,103, 98, 46,119, 41, 59, 10,125, 10, 10,118,111,105,100, 32,104,115,118, 95,116,111, 95,114,103, 98, 40,118,101, 99,
- 52, 32,104,115,118, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10,  9,102,108,111, 97,116,
- 32,105, 44, 32,102, 44, 32,112, 44, 32,113, 44, 32,116, 44, 32,104, 44, 32,115, 44, 32,118, 59, 10,  9,118,101, 99, 51, 32,114,
-103, 98, 59, 10, 10,  9,104, 32, 61, 32,104,115,118, 91, 48, 93, 59, 10,  9,115, 32, 61, 32,104,115,118, 91, 49, 93, 59, 10,  9,
-118, 32, 61, 32,104,115,118, 91, 50, 93, 59, 10, 10,  9,105,102, 40,115, 61, 61, 48, 46, 48, 41, 32,123, 10,  9,  9,114,103, 98,
- 32, 61, 32,118,101, 99, 51, 40,118, 44, 32,118, 44, 32,118, 41, 59, 10,  9,125, 10,  9,101,108,115,101, 32,123, 10,  9,  9,105,
-102, 40,104, 61, 61, 49, 46, 48, 41, 10,  9,  9,  9,104, 32, 61, 32, 48, 46, 48, 59, 10,  9,  9, 10,  9,  9,104, 32, 42, 61, 32,
- 54, 46, 48, 59, 10,  9,  9,105, 32, 61, 32,102,108,111,111,114, 40,104, 41, 59, 10,  9,  9,102, 32, 61, 32,104, 32, 45, 32,105,
- 59, 10,  9,  9,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,102, 44, 32,102, 44, 32,102, 41, 59, 10,  9,  9,112, 32, 61, 32,118,
- 42, 40, 49, 46, 48, 45,115, 41, 59, 10,  9,  9,113, 32, 61, 32,118, 42, 40, 49, 46, 48, 45, 40,115, 42,102, 41, 41, 59, 10,  9,
-  9,116, 32, 61, 32,118, 42, 40, 49, 46, 48, 45, 40,115, 42, 40, 49, 46, 48, 45,102, 41, 41, 41, 59, 10,  9,  9, 10,  9,  9,105,
-102, 32, 40,105, 32, 61, 61, 32, 48, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,118, 44, 32,116, 44, 32,112, 41,
- 59, 10,  9,  9,101,108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 49, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99,
- 51, 40,113, 44, 32,118, 44, 32,112, 41, 59, 10,  9,  9,101,108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 50, 46, 48, 41,
- 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,112, 44, 32,118, 44, 32,116, 41, 59, 10,  9,  9,101,108,115,101, 32,105,102, 32,
- 40,105, 32, 61, 61, 32, 51, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,112, 44, 32,113, 44, 32,118, 41, 59, 10,
-  9,  9,101,108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 52, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,
-116, 44, 32,112, 44, 32,118, 41, 59, 10,  9,  9,101,108,115,101, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,118, 44, 32,112,
- 44, 32,113, 41, 59, 10,  9,125, 10, 10,  9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,114,103, 98, 44, 32,104,115,
-118, 46,119, 41, 59, 10,125, 10, 10, 35,100,101,102,105,110,101, 32, 77, 95, 80, 73, 32, 51, 46, 49, 52, 49, 53, 57, 50, 54, 53,
- 51, 53, 56, 57, 55, 57, 51, 50, 51, 56, 52, 54, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 83, 72, 65, 68, 69,
- 82, 32, 78, 79, 68, 69, 83, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,118,
- 99,111,108, 95, 97,116,116,114,105, 98,117,116,101, 40,118,101, 99, 52, 32, 97,116,116,118, 99,111,108, 44, 32,111,117,116, 32,
-118,101, 99, 52, 32,118, 99,111,108, 41, 10,123, 10,  9,118, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 97,116,116,118, 99,111,
-108, 46,120, 47, 50, 53, 53, 46, 48, 44, 32, 97,116,116,118, 99,111,108, 46,121, 47, 50, 53, 53, 46, 48, 44, 32, 97,116,116,118,
- 99,111,108, 46,122, 47, 50, 53, 53, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,117,118, 95, 97,116,
-116,114,105, 98,117,116,101, 40,118,101, 99, 50, 32, 97,116,116,117,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 41,
- 10,123, 10,  9,117,118, 32, 61, 32,118,101, 99, 51, 40, 97,116,116,117,118, 42, 50, 46, 48, 32, 45, 32,118,101, 99, 50, 40, 49,
- 46, 48, 44, 32, 49, 46, 48, 41, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,103,101,111,109, 40,118,101, 99,
- 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,110,111,114, 44, 32,109, 97,116, 52, 32,118,105,101,119,105,110,118,109, 97,116, 44,
- 32,118,101, 99, 51, 32, 97,116,116,111,114, 99,111, 44, 32,118,101, 99, 50, 32, 97,116,116,117,118, 44, 32,118,101, 99, 52, 32,
- 97,116,116,118, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,103,108,111, 98, 97,108, 44, 32,111,117,116, 32,118,101,
- 99, 51, 32,108,111, 99, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,111,117,116, 32,118,101, 99,
- 51, 32,111,114, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list