-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from kochol/shaders
The new Material system added
- Loading branch information
Showing
28 changed files
with
870 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,5 @@ | |
.fips-settings.yml | ||
*.pyc | ||
*.ktx | ||
tests/07-gltf/assets/Buggy.gltf | ||
tests/07-gltf/assets/Buggy0.bin |
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
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,37 @@ | ||
#pragma once | ||
|
||
#include "gfx.hpp" | ||
#include "core/string/StringAtom.hpp" | ||
|
||
namespace ari::gfx | ||
{ | ||
struct MaterialUniformInfo | ||
{ | ||
core::StringAtom Name; | ||
int Size; | ||
int Offset; | ||
ShaderStage Stage; | ||
bool SystemData; //! This uniform is filled by engine or can be set by user | ||
}; | ||
|
||
//! The material base class. This class dose not store the uniform params. They are in MaterialInstance | ||
struct Material | ||
{ | ||
bool HasTexcoord = false; | ||
bool HasVertexColor = false; | ||
bool HasNormal = false; | ||
|
||
// User controlled values | ||
float SpecularStrength = 1.0f; | ||
sx_vec4 BaseColor = sx_vec4f(1.f, 1.f, 1.f, 1.f); | ||
|
||
sg_shader_desc* shader_desc = nullptr; | ||
ShaderHandle shader; | ||
const core::Array<MaterialUniformInfo>* Uniforms; | ||
int VS_UniformSize; | ||
int FS_UniformSize; | ||
core::Array<float> Vs_UniformData; | ||
core::Array<float> Fs_UniformData; | ||
}; | ||
|
||
} // namespace ari::gfx |
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,14 @@ | ||
#pragma once | ||
|
||
namespace ari::gfx | ||
{ | ||
struct MaterialInstance | ||
{ | ||
// Ambient color | ||
// Diffuse color | ||
// Specular color | ||
// Textures | ||
// Parent Material | ||
}; | ||
|
||
} // namespace ari::gfx |
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,10 @@ | ||
#pragma once | ||
|
||
namespace ari::gfx | ||
{ | ||
struct MaterialParams | ||
{ | ||
|
||
}; | ||
|
||
} // namespace ari::gfx |
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
Oops, something went wrong.