Skip to content

Commit

Permalink
Remove logs that are not useful
Browse files Browse the repository at this point in the history
These will become useful at some point,
but not right now
  • Loading branch information
enginmanap committed Nov 25, 2024
1 parent d898610 commit 36ad310
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
24 changes: 12 additions & 12 deletions Engine/renderPipeline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
<VertexShader>./Engine/Shaders/ShadowMapPoint/vertex.glsl</VertexShader>
<GeometryShader>./Engine/Shaders/ShadowMapPoint/geometry.glsl</GeometryShader>
<FragmentShader>./Engine/Shaders/ShadowMapPoint/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
</GraphicsProgram>
</Method>
</RenderMethods>
Expand Down Expand Up @@ -384,7 +384,7 @@
<VertexShader>./Engine/Shaders/ShadowMapDirectional/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/ShadowMapDirectional/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
</GraphicsProgram>
</Method>
</RenderMethods>
Expand Down Expand Up @@ -464,7 +464,7 @@
<VertexShader>./Engine/Shaders/SSAOGeneration/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/SSAOGeneration/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
<PresetValues>
<Uniform Name="pre_depthMap">2</Uniform>
<Uniform Name="pre_normalMap">1</Uniform>
Expand Down Expand Up @@ -506,7 +506,7 @@
<VertexShader>./Engine/Shaders/SSAOBlur/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/SSAOBlur/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
<PresetValues>
<Uniform Name="pre_ssaoResult">1</Uniform>
</PresetValues>
Expand Down Expand Up @@ -546,7 +546,7 @@
<VertexShader>./Engine/Shaders/CombineColorsWithSSAO/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/CombineColorsWithSSAO/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
<PresetValues>
<Uniform Name="pre_depthMap">4</Uniform>
<Uniform Name="pre_diffuseSpecularLighted">3</Uniform>
Expand Down Expand Up @@ -593,7 +593,7 @@
<VertexShader>./Engine/Shaders/SkyCube/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/SkyCube/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
</GraphicsProgram>
</Method>
</RenderMethods>
Expand Down Expand Up @@ -673,7 +673,7 @@
<VertexShader>./Engine/Shaders/Particles/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/Particles/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
</GraphicsProgram>
</Method>
<Method>
Expand All @@ -683,7 +683,7 @@
<VertexShader>./Engine/Shaders/GPUParticles/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/GPUParticles/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
</GraphicsProgram>
</Method>
</RenderMethods>
Expand Down Expand Up @@ -719,7 +719,7 @@
<VertexShader>./Engine/Shaders/ImGui/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/ImGui/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
</GraphicsProgram>
</Method>
</RenderMethods>
Expand Down Expand Up @@ -755,7 +755,7 @@
<VertexShader>./Engine/Shaders/GUIText/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/GUIText/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
</GraphicsProgram>
</Method>
<Method>
Expand All @@ -765,7 +765,7 @@
<VertexShader>./Engine/Shaders/GUIImage/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/GUIImage/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
</GraphicsProgram>
</Method>
<Method>
Expand All @@ -775,7 +775,7 @@
<VertexShader>./Engine/Shaders/Lines/vertex.glsl</VertexShader>
<GeometryShader></GeometryShader>
<FragmentShader>./Engine/Shaders/Lines/fragment.glsl</FragmentShader>
<MaterialRequired>True</MaterialRequired>
<MaterialRequired>False</MaterialRequired>
</GraphicsProgram>
</Method>
</RenderMethods>
Expand Down
9 changes: 5 additions & 4 deletions src/Assets/AssetManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,13 @@ AssetManager::getAvailableAssetsTreeFilteredRecursive(const AvailableAssetsNode
std::shared_ptr<Material> AssetManager::registerMaterial(std::shared_ptr<Material> material) {
auto foundIt = materials.find(material->getHash());
if(foundIt != materials.end()) {
std::cerr << "Material found, return "<< material->getName() << std::endl;
//std::cerr << "Material found, return "<< material->getName() << std::endl;

foundIt->second.second++;
return foundIt->second.first;
}
//not found, add
std::cerr << "Material not found, create for " << material->getName() << std::endl;
//std::cerr << "Material not found, create for " << material->getName() << std::endl;
materials[material->getHash()] = std::make_pair(material, 1);
return material;

Expand All @@ -209,11 +210,11 @@ void AssetManager::unregisterMaterial(std::shared_ptr<Material> material) {
if(materialIt == materials.end()) {
std::cerr << "Unregister for non existent material found!" << std::endl;
}
std::cerr << "Material unregister " << material->getName() << std::endl;
//std::cerr << "Material unregister " << material->getName() << std::endl;
materialIt->second.second--;
if(materialIt->second.second == 0) {
//time to remove the item
materials.erase(materialIt);
std::cerr << "Material getting deleted " << material->getName() << std::endl;
//std::cerr << "Material getting deleted " << material->getName() << std::endl;
}
}
8 changes: 7 additions & 1 deletion src/Material.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,13 @@ class Material {
}

~Material() {
std::cerr << "Destructor for " << name << std::endl;
//std::cerr << "Destructor for " << name << std::endl;

/**
* Why are we setting the textures to nullptr here?
* Because otherwise Asset manager detects the texture has a
* shared_ptr to it and logs an error.
*/
if (ambientTexture != nullptr) {
assetManager->freeAsset({ambientTexture->getName()});
this->ambientTexture = nullptr;
Expand Down

0 comments on commit 36ad310

Please sign in to comment.