Sfoglia il codice sorgente

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 anni fa
parent
commit
747ab5a431
1 ha cambiato i file con 26 aggiunte e 2 eliminazioni
  1. 26 2
      examples/scenes/test_scene.js

+ 26 - 2
examples/scenes/test_scene.js

@@ -11,7 +11,7 @@
 "objects":
 {
 	"cube1" : {
-		"geometry" : "cube",
+		"geometry" : "cubeNormals",
 		"materials": [ "lambert_red" ],
 		"position" : [ 0, 0, 0 ],
 		"rotation" : [ 0, -0.3, 0 ],
@@ -20,7 +20,7 @@
 	},
 
 	"cube2" : {
-		"geometry" : "cube",
+		"geometry" : "cubeWire",
 		"materials": [ "basic_white" ],
 		"position" : [ 0, 0, 0 ],
 		"rotation" : [ 0, -0.3, 0 ],
@@ -153,6 +153,30 @@
 		"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": {
 		"type"   : "plane",
 		"width"  : 10,