Browse Source

Fixed GL warnings in scene loader example.

For some reason before it didn't make troubles when sharing the same geometry for objects with materials requiring different attributes. I guess order of initialization may had changed.

Fixes #1876.
alteredq 13 years ago
parent
commit
747ab5a431
1 changed files with 26 additions and 2 deletions
  1. 26 2
      examples/scenes/test_scene.js

+ 26 - 2
examples/scenes/test_scene.js

@@ -11,7 +11,7 @@
 "objects":
 "objects":
 {
 {
 	"cube1" : {
 	"cube1" : {
-		"geometry" : "cube",
+		"geometry" : "cubeNormals",
 		"materials": [ "lambert_red" ],
 		"materials": [ "lambert_red" ],
 		"position" : [ 0, 0, 0 ],
 		"position" : [ 0, 0, 0 ],
 		"rotation" : [ 0, -0.3, 0 ],
 		"rotation" : [ 0, -0.3, 0 ],
@@ -20,7 +20,7 @@
 	},
 	},
 
 
 	"cube2" : {
 	"cube2" : {
-		"geometry" : "cube",
+		"geometry" : "cubeWire",
 		"materials": [ "basic_white" ],
 		"materials": [ "basic_white" ],
 		"position" : [ 0, 0, 0 ],
 		"position" : [ 0, 0, 0 ],
 		"rotation" : [ 0, -0.3, 0 ],
 		"rotation" : [ 0, -0.3, 0 ],
@@ -153,6 +153,30 @@
 		"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
 		"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
 	},
 	},
 
 
+	"cubeNormals": {
+		"type"  : "cube",
+		"width" : 10,
+		"height": 10,
+		"depth" : 10,
+		"segmentsWidth"  : 1,
+		"segmentsHeight" : 1,
+		"segmentsDepth"  : 1,
+		"flipped" : false,
+		"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
+	},
+
+	"cubeWire": {
+		"type"  : "cube",
+		"width" : 10,
+		"height": 10,
+		"depth" : 10,
+		"segmentsWidth"  : 1,
+		"segmentsHeight" : 1,
+		"segmentsDepth"  : 1,
+		"flipped" : false,
+		"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
+	},
+
 	"plane": {
 	"plane": {
 		"type"   : "plane",
 		"type"   : "plane",
 		"width"  : 10,
 		"width"  : 10,