|
@@ -284,8 +284,7 @@ func (r *Renderer) renderScene(iscene core.INode, icam camera.ICamera) error {
|
|
|
// Append all graphic materials of this graphic to list of graphic materials to be rendered
|
|
// Append all graphic materials of this graphic to list of graphic materials to be rendered
|
|
|
materials := gr.Materials()
|
|
materials := gr.Materials()
|
|
|
for i := 0; i < len(materials); i++ {
|
|
for i := 0; i < len(materials); i++ {
|
|
|
- mat := materials[i].GetMaterial().GetMaterial()
|
|
|
|
|
- if mat.Transparent() {
|
|
|
|
|
|
|
+ if materials[i].GetMaterial().GetMaterial().Transparent() {
|
|
|
r.grmatsTransp = append(r.grmatsTransp, &materials[i])
|
|
r.grmatsTransp = append(r.grmatsTransp, &materials[i])
|
|
|
} else {
|
|
} else {
|
|
|
r.grmatsOpaque = append(r.grmatsOpaque, &materials[i])
|
|
r.grmatsOpaque = append(r.grmatsOpaque, &materials[i])
|
|
@@ -293,6 +292,8 @@ func (r *Renderer) renderScene(iscene core.INode, icam camera.ICamera) error {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // TODO: If both GraphicMaterials belong to same Graphic we might want to keep their relative order...
|
|
|
|
|
+
|
|
|
// Z-sort graphic materials (opaque front-to-back and transparent back-to-front)
|
|
// Z-sort graphic materials (opaque front-to-back and transparent back-to-front)
|
|
|
if r.sortObjects {
|
|
if r.sortObjects {
|
|
|
// Internal function to render a list of graphic materials
|
|
// Internal function to render a list of graphic materials
|