Bläddra i källkod

changing uniform transfers...

leonsal 8 år sedan
förälder
incheckning
b6e049300a
2 ändrade filer med 2 tillägg och 2 borttagningar
  1. 0 1
      renderer/shaders/sources.go
  2. 2 1
      texture/texture2D.go

+ 0 - 1
renderer/shaders/sources.go

@@ -143,7 +143,6 @@ uniform vec3 Material[6];
     // Texture parameters (3*vec2 per texture)
     uniform vec2 MatTexinfo[3*MAT_TEXTURES];
     // Macros to access elements inside the MatTexinfo array
-    // Each texture uses 3 vec2 elements.
     #define MatTexOffset(a)		MatTexinfo[(3*a)]
     #define MatTexRepeat(a)		MatTexinfo[(3*a)+1]
     #define MatTexFlipY(a)		bool(MatTexinfo[(3*a)+2].x)

+ 2 - 1
texture/texture2D.go

@@ -339,10 +339,11 @@ func (t *Texture2D) RenderSetup(gs *gls.GLS, idx int) {
 	// Transfer texture unit uniform
 	location := t.uniUnit.LocationIdx(gs, int32(idx))
 	gs.Uniform1i(location, int32(idx))
+	log.Error("unit location:%v", location)
 
 	// Transfer texture info combined uniform
 	const vec2count = 3
 	location = t.uniInfo.LocationIdx(gs, vec2count*int32(idx))
-	log.Error("location:%v count:%v udata:%v", location, vec2count, t.udata)
+	log.Error("info location:%v count:%v udata:%v", location, vec2count, t.udata)
 	gs.Uniform2fvUP(location, vec2count, unsafe.Pointer(&t.udata))
 }