-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SGE] Implemented SGE::Material::get<SGE::Texture>(); improvement in …
…diagnostic messages upon invalid usage of material setters and getters
- Loading branch information
Showing
18 changed files
with
575 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
***This is computer generated notice - Do not modify it*** | ||
VulkanRenderer (inclusive of its dependencies and subprojects | ||
such as toolchains written by the same author) is a software to render | ||
2D & 3D geometries by writing C/C++ code and shaders. | ||
File: TID-48.case5.h is a part of VulkanRenderer | ||
Copyright (C) 2021 - 2024 Author: Ravi Prakash Singh | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#pragma once | ||
|
||
|
||
#include <sge/test.h> | ||
|
||
BEGIN_CPP_COMPATIBLE | ||
|
||
TEST_DECLARE(MATERIAL_GET_SET); | ||
|
||
END_CPP_COMPATIBLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
/* | ||
***This is computer generated notice - Do not modify it*** | ||
|
||
VulkanRenderer (inclusive of its dependencies and subprojects | ||
such as toolchains written by the same author) is a software to render | ||
2D & 3D geometries by writing C/C++ code and shaders. | ||
|
||
File: texture_sample.v3dshader is a part of VulkanRenderer | ||
|
||
Copyright (C) 2021 - 2024 Author: Ravi Prakash Singh | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#sl version 2023 | ||
#sb version 2023 | ||
|
||
Shader | ||
{ | ||
Properties | ||
{ | ||
[Stage(fragment)] | ||
[Set(material_set, texture0)] | ||
uniform sampler2D albedo; | ||
|
||
[Stage(fragment, vertex)] | ||
[Set(material_set, material_properties)] | ||
uniform Parameters | ||
{ | ||
vec4 color; | ||
float testValue; | ||
int testValue2; | ||
vec3 testValue3; | ||
} parameters; | ||
} | ||
|
||
Layout | ||
{ | ||
[Rate(per_vertex)] | ||
[MeshLayout(sge_optimal)] | ||
[Attribute(position)] | ||
vec3 position; | ||
|
||
[Rate(per_vertex)] | ||
[MeshLayout(sge_optimal)] | ||
[Attribute(texcoord)] | ||
vec2 texcoord; | ||
} | ||
|
||
RenderPass | ||
{ | ||
SubPass | ||
{ | ||
[NoParse] | ||
GraphicsPipeline | ||
{ | ||
colorBlend | ||
{ | ||
attachment | ||
{ | ||
blendenable = true | ||
} | ||
} | ||
|
||
depthStencil | ||
{ | ||
depthWriteEnable = true, | ||
depthTestEnable = true | ||
} | ||
} | ||
|
||
[NoParse] | ||
GLSL | ||
{ | ||
#stage vertex | ||
|
||
#version 450 | ||
|
||
#include <v3d.h> | ||
|
||
layout(SGE_UNIFORM_BUFFER_LAYOUT, set = CAMERA_SET, binding = CAMERA_PROPERTIES_BINDING) uniform CameraInfo cameraInfo; | ||
layout(SGE_UNIFORM_BUFFER_LAYOUT, set = OBJECT_SET, binding = TRANSFORM_BINDING) uniform ObjectInfo objectInfo; | ||
|
||
layout(location = POSITION_LOCATION) in vec3 position; | ||
layout(location = TEXCOORD_LOCATION) in vec2 texcoord; | ||
|
||
layout(location = 0) out vec2 _texcoord; | ||
|
||
void main() | ||
{ | ||
vec4 clipPos = cameraInfo.projection * cameraInfo.view * objectInfo.transform * vec4(position, 1); | ||
clipPos.y = -clipPos.y; | ||
gl_Position = clipPos; | ||
_texcoord = texcoord; | ||
} | ||
|
||
#stage fragment | ||
|
||
#version 450 | ||
|
||
#include <v3d.h> | ||
|
||
layout(set = MATERIAL_SET, binding = TEXTURE_BINDING0) uniform sampler2D albedo; | ||
|
||
layout(location = 0) in vec2 _texcoord; | ||
layout(location = 0) out vec4 color; | ||
|
||
void main() | ||
{ | ||
color = texture(albedo, _texcoord).rgba; | ||
} | ||
|
||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.