Skip to content

Commit

Permalink
3d-debug non cachable error from lassimp ibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
net-cscience-raphael committed Jun 12, 2024
1 parent 2e8731c commit c582799
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
package org.vitrivr.cineast.core.data.m3d.texturemodel;


import static org.lwjgl.assimp.Assimp.AI_MATKEY_COLOR_AMBIENT;
import static org.lwjgl.assimp.Assimp.AI_MATKEY_COLOR_DIFFUSE;
import static org.lwjgl.assimp.Assimp.AI_MATKEY_SHININESS;
import static org.lwjgl.assimp.Assimp.AI_MATKEY_SHININESS_STRENGTH;
import static org.lwjgl.assimp.Assimp.aiGetMaterialColor;
import static org.lwjgl.assimp.Assimp.aiGetMaterialFloatArray;
import static org.lwjgl.assimp.Assimp.aiGetMaterialTexture;
import static org.lwjgl.assimp.Assimp.aiImportFile;
import static org.lwjgl.assimp.Assimp.aiProcess_CalcTangentSpace;
import static org.lwjgl.assimp.Assimp.aiProcess_FixInfacingNormals;
import static org.lwjgl.assimp.Assimp.aiProcess_GenNormals;
import static org.lwjgl.assimp.Assimp.aiProcess_GenSmoothNormals;
import static org.lwjgl.assimp.Assimp.aiProcess_GlobalScale;
import static org.lwjgl.assimp.Assimp.aiProcess_JoinIdenticalVertices;
import static org.lwjgl.assimp.Assimp.aiProcess_LimitBoneWeights;
import static org.lwjgl.assimp.Assimp.aiProcess_PreTransformVertices;
import static org.lwjgl.assimp.Assimp.aiProcess_Triangulate;
import static org.lwjgl.assimp.Assimp.aiReleaseImport;
import static org.lwjgl.assimp.Assimp.aiReturn_SUCCESS;
import static org.lwjgl.assimp.Assimp.aiTextureType_DIFFUSE;
import static org.lwjgl.assimp.Assimp.aiTextureType_NONE;
import static org.lwjgl.assimp.Assimp.aiTextureType_NORMALS;

import java.io.File;
import java.nio.IntBuffer;
import java.util.ArrayList;
Expand All @@ -38,6 +15,8 @@
import org.vitrivr.cineast.core.data.m3d.texturemodel.util.TextureLoadException;
import org.vitrivr.cineast.core.data.m3d.texturemodel.util.TimeLimitedFunc;

import static org.lwjgl.assimp.Assimp.*;

public final class ModelLoader {

private static final Logger LOGGER = LogManager.getLogger();
Expand Down Expand Up @@ -119,7 +98,11 @@ public static Model loadModel(String modelId, String modelPath) throws TextureLo
aiProcess_CalcTangentSpace |
aiProcess_LimitBoneWeights |
aiProcess_PreTransformVertices |
aiProcess_GenSmoothNormals
aiProcess_GenSmoothNormals |
aiProcess_FindInvalidData |
aiProcess_FindDegenerates |
aiProcess_ValidateDataStructure

);
LOGGER.trace("Try return Model 2");
return model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public void render(GLScene scene, RenderOptions opt) {
for (var model : models) {
var entities = model.getEntities();
for (var material : model.getMaterials()) {

GLTexture texture;

// Either draw texture or use color function
Expand Down Expand Up @@ -204,7 +205,6 @@ public void render(GLScene scene, RenderOptions opt) {
}
}
GL30.glBindVertexArray(0);

this.shaderProgram.unbind();
}

Expand Down

0 comments on commit c582799

Please sign in to comment.