New Asset iteration
Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
#ifndef EV_GLSL_CONSTANTS_H
|
||||
#define EV_GLSL_CONSTANTS_H
|
||||
|
||||
#define PI 3.1415926538
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef EV_GLSL_SRGB_OPS_H
|
||||
#define EV_GLSL_SRGB_OPS_H
|
||||
|
||||
vec4 LinearToSRGB(vec4 linearRGB)
|
||||
{
|
||||
bvec4 cutoff = lessThan(linearRGB, vec4(0.0031308));
|
||||
vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);
|
||||
vec4 lower = linearRGB * vec4(12.92);
|
||||
|
||||
return mix(higher, lower, cutoff);
|
||||
}
|
||||
|
||||
vec4 SRGBToLinear(vec4 sRGB)
|
||||
{
|
||||
bvec4 cutoff = lessThan(sRGB, vec4(0.04045));
|
||||
vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));
|
||||
vec4 lower = sRGB/vec4(12.92);
|
||||
|
||||
return mix(higher, lower, cutoff);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef EV_GLSL_TYPES_H
|
||||
#define EV_GLSL_TYPES_H
|
||||
|
||||
struct Material {
|
||||
vec4 baseColor;
|
||||
uint albedoTexture;
|
||||
|
||||
uint normalTexture;
|
||||
|
||||
float metallicFactor;
|
||||
float roughnessFactor;
|
||||
uint metallicRoughnessTexture;
|
||||
|
||||
vec4 emissiveFactor;
|
||||
uint emissiveTexture;
|
||||
};
|
||||
|
||||
struct Vertex {
|
||||
vec4 position;
|
||||
vec4 normal;
|
||||
vec2 uv[2];
|
||||
vec4 tangent;
|
||||
vec4 bitangent; // No longer needed. // TODO remove
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user