-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e2813d
commit 185a8ca
Showing
23 changed files
with
569 additions
and
396 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
Binary file not shown.
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,8 @@ | ||
struct Camera { | ||
mat4 view; | ||
mat4 proj; | ||
mat4 invertedProj; | ||
vec4 eye; | ||
float zNear; | ||
float zFar; | ||
}; |
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,58 @@ | ||
const uint NO_TEXTURE_ID = 255; | ||
|
||
const uint ALPHA_MODE_MASK = 1; | ||
const uint ALPHA_MODE_BLEND = 2; | ||
const float ALPHA_CUTOFF_BIAS = 0.0000001; | ||
|
||
const uint METALLIC_ROUGHNESS_WORKFLOW = 0; | ||
|
||
struct Material { | ||
vec4 color; | ||
vec3 emissiveFactor; | ||
// - roughness for metallic/roughness workflows | ||
// - glossiness for specular/glossiness workflows | ||
float roughnessGlossiness; | ||
// Contains the metallic (or specular) factor. | ||
// - metallic: r (for metallic/roughness workflows) | ||
// - specular: rgb (for specular/glossiness workflows) | ||
vec3 metallicSpecular; | ||
float occlusion; | ||
float alphaCutoff; | ||
float clearcoatFactor; | ||
float clearcoatRoughness; | ||
uint colorTextureChannel; | ||
uint materialTextureChannel; | ||
uint emissiveTextureChannel; | ||
uint normalsTextureChannel; | ||
uint occlusionTextureChannel; | ||
uint clearcoatFactorTextureChannel; | ||
uint clearcoatRoughnessTextureChannel; | ||
uint clearcoatNormalTextureChannel; | ||
uint alphaMode; | ||
bool isUnlit; | ||
uint workflow; | ||
}; | ||
|
||
struct TextureChannels { | ||
uint color; | ||
uint material; | ||
uint emissive; | ||
uint normal; | ||
uint occlusion; | ||
uint clearcoatFactor; | ||
uint clearcoatRoughness; | ||
uint clearcoatNormal; | ||
}; | ||
|
||
TextureChannels getTextureChannels(Material m) { | ||
return TextureChannels( | ||
m.colorTextureChannel, | ||
m.materialTextureChannel, | ||
m.emissiveTextureChannel, | ||
m.normalsTextureChannel, | ||
m.occlusionTextureChannel, | ||
m.clearcoatFactorTextureChannel, | ||
m.clearcoatRoughnessTextureChannel, | ||
m.clearcoatNormalTextureChannel | ||
); | ||
} |
Oops, something went wrong.