Skip to content

Commit

Permalink
Added groups
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-beqiraj committed Feb 6, 2025
1 parent 76db498 commit d46648b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Engine/Shaders/DeferredForwardPipeline/fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void main()
{
currentMaterial = materialData[drawId];

if(statusCopy[drawId].plainColor>1){
if(statusCopy[drawId].plainColor>0){
FragColor=currentMaterial.materialColor;
}else{

Expand Down
2 changes: 1 addition & 1 deletion Engine/Shaders/DeferredPipeline/fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void main()
if (albedoTexture.a < 0.1) {
discard;
}
if(statusCopy[drawId].plainColor>1){
if(statusCopy[drawId].plainColor>0){
gAmbient.b= float(statusCopy[drawId].plainColor);
gAlbedoSpec.rgb = vec3(currentMaterial.materialColor);
}else{
Expand Down
2 changes: 1 addition & 1 deletion Engine/Shaders/ForwardPipeline/fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void main()
#else
currentMaterial = materialData[drawId];
#endif
if(statusCopy[drawId].plainColor>1){
if(statusCopy[drawId].plainColor>0){
FragColor=currentMaterial.materialColor;
}else{

Expand Down
49 changes: 25 additions & 24 deletions GUI/src/NodeCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,40 +205,40 @@ std::shared_ptr<Prisma::Node> Prisma::NodeCreator::createArea()

std::vector<Prisma::Mesh::Vertex> vertices = {
// Front face
{{-1, -1, 0.00001}, {0, 0, 1}, {0, 0}}, // Bottom-left
{{1, -1, 0.00001}, {0, 0, 1}, {1, 0}}, // Bottom-right
{{1, 1, 0.00001}, {0, 0, 1}, {1, 1}}, // Top-right
{{-1, 1, 0.00001}, {0, 0, 1}, {0, 1}}, // Top-left
{{-1, -1, 0.0001}, {0, 0, 1}, {0, 0}}, // Bottom-left
{{1, -1, 0.0001}, {0, 0, 1}, {1, 0}}, // Bottom-right
{{1, 1, 0.0001}, {0, 0, 1}, {1, 1}}, // Top-right
{{-1, 1, 0.0001}, {0, 0, 1}, {0, 1}}, // Top-left

// Back face
{{1, -1, -0.00001}, {0, 0, -1}, {0, 0}}, // Bottom-left
{{-1, -1, -0.00001}, {0, 0, -1}, {1, 0}}, // Bottom-right
{{-1, 1, -0.00001}, {0, 0, -1}, {1, 1}}, // Top-right
{{1, 1, -0.00001}, {0, 0, -1}, {0, 1}}, // Top-left
{{1, -1, -0.0001}, {0, 0, -1}, {0, 0}}, // Bottom-left
{{-1, -1, -0.0001}, {0, 0, -1}, {1, 0}}, // Bottom-right
{{-1, 1, -0.0001}, {0, 0, -1}, {1, 1}}, // Top-right
{{1, 1, -0.0001}, {0, 0, -1}, {0, 1}}, // Top-left

// Left face
{{-1, -1, -0.00001}, {-1, 0, 0}, {0, 0}}, // Bottom-left
{{-1, -1, 0.00001}, {-1, 0, 0}, {1, 0}}, // Bottom-right
{{-1, 1, 0.00001}, {-1, 0, 0}, {1, 1}}, // Top-right
{{-1, 1, -0.00001}, {-1, 0, 0}, {0, 1}}, // Top-left
{{-1, -1, -0.0001}, {-1, 0, 0}, {0, 0}}, // Bottom-left
{{-1, -1, 0.0001}, {-1, 0, 0}, {1, 0}}, // Bottom-right
{{-1, 1, 0.0001}, {-1, 0, 0}, {1, 1}}, // Top-right
{{-1, 1, -0.0001}, {-1, 0, 0}, {0, 1}}, // Top-left

// Right face
{{1, -1, 0.00001}, {1, 0, 0}, {0, 0}}, // Bottom-left
{{1, -1, -0.00001}, {1, 0, 0}, {1, 0}}, // Bottom-right
{{1, 1, -0.00001}, {1, 0, 0}, {1, 1}}, // Top-right
{{1, 1, 0.00001}, {1, 0, 0}, {0, 1}}, // Top-left
{{1, -1, 0.0001}, {1, 0, 0}, {0, 0}}, // Bottom-left
{{1, -1, -0.0001}, {1, 0, 0}, {1, 0}}, // Bottom-right
{{1, 1, -0.0001}, {1, 0, 0}, {1, 1}}, // Top-right
{{1, 1, 0.0001}, {1, 0, 0}, {0, 1}}, // Top-left

// Top face
{{-1, 1, 0.00001}, {0, 1, 0}, {0, 0}}, // Bottom-left
{{1, 1, 0.00001}, {0, 1, 0}, {1, 0}}, // Bottom-right
{{1, 1, -0.00001}, {0, 1, 0}, {1, 1}}, // Top-right
{{-1, 1, -0.00001}, {0, 1, 0}, {0, 1}}, // Top-left
{{-1, 1, 0.0001}, {0, 1, 0}, {0, 0}}, // Bottom-left
{{1, 1, 0.0001}, {0, 1, 0}, {1, 0}}, // Bottom-right
{{1, 1, -0.0001}, {0, 1, 0}, {1, 1}}, // Top-right
{{-1, 1, -0.0001}, {0, 1, 0}, {0, 1}}, // Top-left

// Bottom face
{{-1, -1, -0.00001}, {0, -1, 0}, {0, 0}}, // Bottom-left
{{1, -1, -0.00001}, {0, -1, 0}, {1, 0}}, // Bottom-right
{{1, -1, 0.00001}, {0, -1, 0}, {1, 1}}, // Top-right
{{-1, -1, 0.00001}, {0, -1, 0}, {0, 1}} // Top-left
{{-1, -1, -0.0001}, {0, -1, 0}, {0, 0}}, // Bottom-left
{{1, -1, -0.0001}, {0, -1, 0}, {1, 0}}, // Bottom-right
{{1, -1, 0.0001}, {0, -1, 0}, {1, 1}}, // Top-right
{{-1, -1, 0.0001}, {0, -1, 0}, {0, 1}} // Top-left
};

// Define indices for each face (two triangles per face)
Expand Down Expand Up @@ -284,6 +284,7 @@ std::shared_ptr<Prisma::Node> Prisma::NodeCreator::createArea()
auto planeArea=createMesh(verticesData, "PlaneArea");
auto whiteMaterial = getEmptyMaterial();
whiteMaterial->color(glm::vec4(1.0));
whiteMaterial->plain(true);
std::dynamic_pointer_cast<Mesh>(planeArea->children()[0])->material(whiteMaterial);
auto parent = std::make_shared<Prisma::Node>();
parent->name("ParentArea_" + std::to_string(parent->uuid()));
Expand Down

0 comments on commit d46648b

Please sign in to comment.