fix shader data type
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
bc74b91066
commit
3c43bca798
@ -17,7 +17,7 @@ in vec2 TexCoord;
|
|||||||
in vec4 FragPosLightSpace;
|
in vec4 FragPosLightSpace;
|
||||||
|
|
||||||
|
|
||||||
uniform vec3 viewPos;
|
uniform dvec3 viewPos;
|
||||||
uniform Material material;
|
uniform Material material;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,7 +30,7 @@ void main(){
|
|||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
vec3 norm = normalize(Normal);
|
vec3 norm = normalize(Normal);
|
||||||
vec3 viewDir = normalize(viewPos - FragPos);
|
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||||
|
|
||||||
//grab light intensity
|
//grab light intensity
|
||||||
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
||||||
|
|||||||
@ -22,7 +22,7 @@ in vec4 FragPosLightSpace;
|
|||||||
|
|
||||||
|
|
||||||
//view position
|
//view position
|
||||||
uniform vec3 viewPos;
|
uniform dvec3 viewPos;
|
||||||
|
|
||||||
//material
|
//material
|
||||||
uniform Material material;
|
uniform Material material;
|
||||||
@ -41,7 +41,7 @@ float weightCalcNew(float finalAlpha, float zLoc, float linearizedLoc);
|
|||||||
void main(){
|
void main(){
|
||||||
|
|
||||||
vec3 norm = normalize(Normal);
|
vec3 norm = normalize(Normal);
|
||||||
vec3 viewDir = normalize(viewPos - FragPos);
|
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||||
|
|
||||||
//grab light intensity
|
//grab light intensity
|
||||||
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
||||||
|
|||||||
@ -18,7 +18,7 @@ in vec2 texPlane3;
|
|||||||
in vec4 FragPosLightSpace;
|
in vec4 FragPosLightSpace;
|
||||||
|
|
||||||
|
|
||||||
uniform vec3 viewPos;
|
uniform dvec3 viewPos;
|
||||||
uniform Material material;
|
uniform Material material;
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ vec3 getColor(vec2 texPlane1, vec2 texPlane2, vec2 texPlane3, vec3 normal, Mater
|
|||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
vec3 norm = normalize(Normal);
|
vec3 norm = normalize(Normal);
|
||||||
vec3 viewDir = normalize(viewPos - FragPos);
|
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||||
|
|
||||||
//grab light intensity
|
//grab light intensity
|
||||||
float lightIntensity = calcLightIntensityTotal(norm);
|
float lightIntensity = calcLightIntensityTotal(norm);
|
||||||
|
|||||||
@ -19,7 +19,7 @@ in vec3 normalRot1;
|
|||||||
in vec3 normalRot2;
|
in vec3 normalRot2;
|
||||||
|
|
||||||
|
|
||||||
uniform vec3 viewPos;
|
uniform dvec3 viewPos;
|
||||||
// uniform DirLight dirLight;
|
// uniform DirLight dirLight;
|
||||||
// uniform PointLight pointLights[NR_POINT_LIGHTS];
|
// uniform PointLight pointLights[NR_POINT_LIGHTS];
|
||||||
// uniform SpotLight spotLight;
|
// uniform SpotLight spotLight;
|
||||||
@ -58,7 +58,7 @@ void main(){
|
|||||||
float normalMultiplier = -(1.0 + -2.0 * int(gl_FrontFacing));
|
float normalMultiplier = -(1.0 + -2.0 * int(gl_FrontFacing));
|
||||||
vec3 norm = normalize(mix(normalRot1,normalRot2,normalMix) * normalMultiplier);
|
vec3 norm = normalize(mix(normalRot1,normalRot2,normalMix) * normalMultiplier);
|
||||||
// vec3 norm = normalize(Normal * normalMultiplier);
|
// vec3 norm = normalize(Normal * normalMultiplier);
|
||||||
vec3 viewDir = normalize(viewPos - FragPos);
|
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||||
|
|
||||||
//grab light intensity
|
//grab light intensity
|
||||||
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
||||||
|
|||||||
@ -31,7 +31,7 @@ uniform mat4 model;
|
|||||||
uniform mat4 view;
|
uniform mat4 view;
|
||||||
uniform mat4 projection;
|
uniform mat4 projection;
|
||||||
uniform mat4 lightSpaceMatrix;
|
uniform mat4 lightSpaceMatrix;
|
||||||
uniform vec3 viewPos;
|
uniform dvec3 viewPos;
|
||||||
uniform vec3 modelWorldPos;
|
uniform vec3 modelWorldPos;
|
||||||
uniform float time;
|
uniform float time;
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ void main() {
|
|||||||
//shift in viewspace to make it feel slightly fuller
|
//shift in viewspace to make it feel slightly fuller
|
||||||
//
|
//
|
||||||
//dot view and normal
|
//dot view and normal
|
||||||
vec3 viewDir = normalize(viewPos - FinalVertex.xyz);
|
vec3 viewDir = normalize(vec3(viewPos) - FinalVertex.xyz);
|
||||||
float viewDotNormal = clamp(dot(FinalNormal.xz,viewDir.xz),0,1);
|
float viewDotNormal = clamp(dot(FinalNormal.xz,viewDir.xz),0,1);
|
||||||
//calculate thinkening factor to shift verts slightly based on view angle
|
//calculate thinkening factor to shift verts slightly based on view angle
|
||||||
float viewSpaceThickenFactor = easeOut(1.0 - viewDotNormal);
|
float viewSpaceThickenFactor = easeOut(1.0 - viewDotNormal);
|
||||||
|
|||||||
@ -22,7 +22,7 @@ in vec4 FragPosLightSpace;
|
|||||||
in vec4 instanceColor;
|
in vec4 instanceColor;
|
||||||
|
|
||||||
|
|
||||||
uniform vec3 viewPos;
|
uniform dvec3 viewPos;
|
||||||
uniform Material material;
|
uniform Material material;
|
||||||
uniform mat4 view;
|
uniform mat4 view;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ float easeIn(float interpolator);
|
|||||||
float easeOut(float interpolator);
|
float easeOut(float interpolator);
|
||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
vec3 viewDir = normalize(viewPos - FragPos);
|
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||||
|
|
||||||
//grab light intensity
|
//grab light intensity
|
||||||
vec3 lightIntensity = vec3(calcLightIntensityTotal(Normal));
|
vec3 lightIntensity = vec3(calcLightIntensityTotal(Normal));
|
||||||
|
|||||||
@ -27,7 +27,7 @@ in vec3 samplerIndexVec; //the indices in the atlas of textures to sample
|
|||||||
in vec3 samplerRatioVec; //the vector of HOW MUCH to pull from each texture in the atlas
|
in vec3 samplerRatioVec; //the vector of HOW MUCH to pull from each texture in the atlas
|
||||||
|
|
||||||
|
|
||||||
uniform vec3 viewPos;
|
uniform dvec3 viewPos;
|
||||||
// uniform DirLight dirLight;
|
// uniform DirLight dirLight;
|
||||||
// uniform PointLight pointLights[NR_POINT_LIGHTS];
|
// uniform PointLight pointLights[NR_POINT_LIGHTS];
|
||||||
// uniform SpotLight spotLight;
|
// uniform SpotLight spotLight;
|
||||||
@ -45,7 +45,7 @@ vec3 getColor(vec2 texPlane1, vec2 texPlane2, vec2 texPlane3, vec3 normal, vec3
|
|||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
vec3 norm = normalize(Normal);
|
vec3 norm = normalize(Normal);
|
||||||
vec3 viewDir = normalize(viewPos - FragPos);
|
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||||
|
|
||||||
//grab light intensity
|
//grab light intensity
|
||||||
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user