add more loop debug logs
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-08-28 21:08:03 -04:00
parent d558e60fd7
commit bca1789457
3 changed files with 13 additions and 5 deletions

View File

@ -80,6 +80,7 @@ public class AssetManager {
*/ */
public void loadAssetsInQueue(){ public void loadAssetsInQueue(){
//models //models
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load models");
for(String currentPath : modelsInQueue){ for(String currentPath : modelsInQueue){
modelsInQueue.remove(currentPath); modelsInQueue.remove(currentPath);
AIScene aiScene = ModelLoader.loadAIScene(currentPath); AIScene aiScene = ModelLoader.loadAIScene(currentPath);
@ -102,11 +103,13 @@ public class AssetManager {
} }
} }
//textures from disk to gpu //textures from disk to gpu
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load textures");
for(String currentPath : texturesInQueue){ for(String currentPath : texturesInQueue){
texturesInQueue.remove(currentPath); texturesInQueue.remove(currentPath);
texturesLoadedIntoMemory.put(currentPath, new Texture(Globals.renderingEngine.getOpenGLState(), currentPath)); texturesLoadedIntoMemory.put(currentPath, new Texture(Globals.renderingEngine.getOpenGLState(), currentPath));
} }
//audio from disk //audio from disk
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load audio");
if(Globals.audioEngine != null && Globals.audioEngine.initialized()){ if(Globals.audioEngine != null && Globals.audioEngine.initialized()){
for(String currentPath : audioInQueue){ for(String currentPath : audioInQueue){
audioInQueue.remove(currentPath); audioInQueue.remove(currentPath);
@ -114,6 +117,7 @@ public class AssetManager {
} }
} }
//shaders //shaders
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load shaders");
for(ActorShaderMask currentShader : shadersInQueue){ for(ActorShaderMask currentShader : shadersInQueue){
shadersInQueue.remove(currentShader); shadersInQueue.remove(currentShader);
String key = getShaderKey(currentShader.getVertexShaderPath(),currentShader.getGeometryShaderPath(),currentShader.getFragmentShaderPath()); String key = getShaderKey(currentShader.getVertexShaderPath(),currentShader.getGeometryShaderPath(),currentShader.getFragmentShaderPath());
@ -130,23 +134,31 @@ public class AssetManager {
} }
} }
//pose models //pose models
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load pose models");
for(String currentPath: poseModelsInQueue){ for(String currentPath: poseModelsInQueue){
poseModelsInQueue.remove(currentPath); poseModelsInQueue.remove(currentPath);
AIScene scene = ModelLoader.loadAIScene(currentPath); AIScene scene = ModelLoader.loadAIScene(currentPath);
poseModelsLoadedIntoMemory.put(currentPath, new PoseModel(currentPath, scene)); poseModelsLoadedIntoMemory.put(currentPath, new PoseModel(currentPath, scene));
} }
//queued assets //queued assets
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load queued assets");
queuedAssetLock.acquireUninterruptibly(); queuedAssetLock.acquireUninterruptibly();
for(QueuedAsset queuedAsset : queuedAssets){ for(QueuedAsset queuedAsset : queuedAssets){
queuedAsset.load(); queuedAsset.load();
} }
queuedAssets.clear(); queuedAssets.clear();
queuedAssetLock.release(); queuedAssetLock.release();
//allocate homogenous buffers //allocate homogenous buffers
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Allocate homogenous buffers");
allocateHomogenousBuffers(); allocateHomogenousBuffers();
//allocate instance array buffers //allocate instance array buffers
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Allocate instance array buffers");
allocateInstanceArrayBuffers(); allocateInstanceArrayBuffers();
//override meshes //override meshes
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Override meshes");
performMeshOverrides(); performMeshOverrides();
} }

View File

@ -25,8 +25,6 @@ public class ModelLoader {
*/ */
public static AIScene loadAIScene(String path){ public static AIScene loadAIScene(String path){
AIScene rVal; AIScene rVal;
// File file = new File(Thread.currentThread().getContextClassLoader().getResource(fileName).getFile());
// Main.class.getResourceAsStream(fileName).readAllBytes();
File toRead = FileUtils.getAssetFile(path); File toRead = FileUtils.getAssetFile(path);
rVal = aiImportFile(toRead.getAbsolutePath(), rVal = aiImportFile(toRead.getAbsolutePath(),
aiProcess_GenSmoothNormals | aiProcess_GenSmoothNormals |
@ -47,6 +45,7 @@ public class ModelLoader {
if(scene != null){ if(scene != null){
rVal = Model.createModelFromAiscene(path, scene); rVal = Model.createModelFromAiscene(path, scene);
attemptAddTexturesFromPathname(path, localTextureMap, rVal); attemptAddTexturesFromPathname(path, localTextureMap, rVal);
LoggerInterface.loggerRenderer.DEBUG("Finished loading model " + path);
} }
return rVal; return rVal;
} }
@ -110,7 +109,6 @@ public class ModelLoader {
LoggerInterface.loggerRenderer.DEBUG(mesh.getMeshName() + "->" + diffusePath); LoggerInterface.loggerRenderer.DEBUG(mesh.getMeshName() + "->" + diffusePath);
if(diffusePath != null){ if(diffusePath != null){
LoggerInterface.loggerRenderer.DEBUG(diffusePath); LoggerInterface.loggerRenderer.DEBUG(diffusePath);
// Texture diffuse = new Texture(diffuse_path);
Globals.assetManager.addTexturePathtoQueue(diffusePath); Globals.assetManager.addTexturePathtoQueue(diffusePath);
finalMat.set_diffuse(diffusePath); finalMat.set_diffuse(diffusePath);
LoggerInterface.loggerRenderer.DEBUG(diffusePath); LoggerInterface.loggerRenderer.DEBUG(diffusePath);
@ -121,7 +119,6 @@ public class ModelLoader {
//set specular //set specular
String specularPath = meshTextureData.getSpecular(); String specularPath = meshTextureData.getSpecular();
if(specularPath != null){ if(specularPath != null){
// Texture specular = new Texture(specular_path);
Globals.assetManager.addTexturePathtoQueue(specularPath); Globals.assetManager.addTexturePathtoQueue(specularPath);
finalMat.set_specular(specularPath); finalMat.set_specular(specularPath);
LoggerInterface.loggerRenderer.DEBUG(specularPath); LoggerInterface.loggerRenderer.DEBUG(specularPath);

View File

@ -7,7 +7,6 @@ import static org.lwjgl.opengl.GL20.GL_LINK_STATUS;
import static org.lwjgl.opengl.GL20.GL_VERTEX_SHADER; import static org.lwjgl.opengl.GL20.GL_VERTEX_SHADER;
import static org.lwjgl.opengl.GL20.glAttachShader; import static org.lwjgl.opengl.GL20.glAttachShader;
import static org.lwjgl.opengl.GL20.glCompileShader; import static org.lwjgl.opengl.GL20.glCompileShader;
import static org.lwjgl.opengl.GL20.glCreateProgram;
import static org.lwjgl.opengl.GL20.glCreateShader; import static org.lwjgl.opengl.GL20.glCreateShader;
import static org.lwjgl.opengl.GL20.glDeleteShader; import static org.lwjgl.opengl.GL20.glDeleteShader;
import static org.lwjgl.opengl.GL20.glGetProgramInfoLog; import static org.lwjgl.opengl.GL20.glGetProgramInfoLog;