diff --git a/.classpath b/.classpath index 4985ef2..ce0ee5c 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,7 @@ - + diff --git a/src/org/atriasoft/loader3d/resources/ResourceMesh.java b/src/org/atriasoft/loader3d/resources/ResourceMesh.java index 4494dfd..9b08bab 100644 --- a/src/org/atriasoft/loader3d/resources/ResourceMesh.java +++ b/src/org/atriasoft/loader3d/resources/ResourceMesh.java @@ -413,6 +413,8 @@ void setNormalMode(NormalMode _mode) { // Log.debug("nb cycle ? : " + tmpppppp); // #endif } + + List outIndex = new ArrayList<>(); if (this.listPaletteFaces.size() != 0) { FaceIndexing outputIndex = new FaceIndexing(); //Add palette virtual material: @@ -481,6 +483,7 @@ void setNormalMode(NormalMode _mode) { } for(int indice=0 ; indice PALETTE_ELEMENTS = new ArrayList<>(COUNT_MAX_COLOR_PALETTE); static { PALETTE_ELEMENTS.add("unknown"); @@ -180,9 +180,21 @@ public class ResourcePaletteFile extends Resource { int width = COUNT_MAX_COLOR_PALETTE; int height = 8; ImageByteRGBA out = new ImageByteRGBA(width, height); + //ImageByteRGB out = new ImageByteRGB(width, height); + // clear the palette: + //float val = 0.0f; + for (int xxx=0; xxx < width; xxx++) { + for (int yyy=0; yyy < 8; yyy++) { + out.setColorFloat(xxx, yyy, 1, 1, 1, 1); + //out.setColorFloat(xxx, yyy, val, val + 0.125f, val + 0.85f, 1); + //val += 0.01f; + } + } + for (Entry it : this.list.entrySet()) { int id = getColorId(it.getKey()); MaterialBase mat = it.getValue(); + Log.error("add Material in texture: '" + it.getKey() + "' ==> " + id + " mat=" + mat); // 2 element this will permit to change color in the future on depend on some parameters... out.setColorFloat(id, 0, mat.getDiffuseFactor().x(), mat.getDiffuseFactor().y(), mat.getDiffuseFactor().z(), mat.getDiffuseFactor().w()); out.setColorFloat(id, 1, mat.getDiffuseFactor().x(), mat.getDiffuseFactor().y(), mat.getDiffuseFactor().z(), mat.getDiffuseFactor().w()); diff --git a/src/org/atriasoft/loader3d/resources/ResourceStaticMesh.java b/src/org/atriasoft/loader3d/resources/ResourceStaticMesh.java index c7f1480..ee00ae6 100644 --- a/src/org/atriasoft/loader3d/resources/ResourceStaticMesh.java +++ b/src/org/atriasoft/loader3d/resources/ResourceStaticMesh.java @@ -39,6 +39,12 @@ public class ResourceStaticMesh extends Resource { } this.vao.render(this.mode); } + public void renderArrays() { + if (this.vao == null) { + return; + } + this.vao.renderArrays(this.mode); + } public void setMode(final RenderMode mode) { this.mode = mode;