unnecessary spacing
This commit is contained in:
parent
d46963a724
commit
8f1dee6545
|
|
@ -8,13 +8,13 @@ varying vec4 fragColor;
|
||||||
varying vec3 fragNormal;
|
varying vec3 fragNormal;
|
||||||
|
|
||||||
uniform sampler2D texture0;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 colDiffuse;
|
uniform vec4 colDiffuse;
|
||||||
uniform vec3 viewPos;
|
uniform vec3 viewPos;
|
||||||
uniform float numBands;
|
uniform float numBands;
|
||||||
|
|
||||||
struct Light {
|
struct Light {
|
||||||
int enabled;
|
int enabled;
|
||||||
int type;
|
int type;
|
||||||
vec3 position;
|
vec3 position;
|
||||||
vec3 target;
|
vec3 target;
|
||||||
vec4 color;
|
vec4 color;
|
||||||
|
|
@ -23,9 +23,9 @@ uniform Light lights[4];
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 texColor = texture2D(texture0, fragTexCoord);
|
vec4 texColor = texture2D(texture0, fragTexCoord);
|
||||||
vec3 baseColor = texColor.rgb * fragColor.rgb * colDiffuse.rgb;
|
vec3 baseColor = texColor.rgb * fragColor.rgb * colDiffuse.rgb;
|
||||||
vec3 norm = normalize(fragNormal);
|
vec3 norm = normalize(fragNormal);
|
||||||
|
|
||||||
float lightAccum = 0.08; // ambient floor
|
float lightAccum = 0.08; // ambient floor
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ varying vec2 fragTexCoord;
|
||||||
varying vec4 fragColor;
|
varying vec4 fragColor;
|
||||||
varying vec3 fragNormal;
|
varying vec3 fragNormal;
|
||||||
|
|
||||||
// inverse() and transpose() are not built-in until GLSL 1.40 / ES 3.0
|
|
||||||
mat3 inverse(mat3 m)
|
mat3 inverse(mat3 m)
|
||||||
{
|
{
|
||||||
float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];
|
float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];
|
||||||
|
|
@ -39,10 +38,10 @@ void main()
|
||||||
{
|
{
|
||||||
fragPosition = vec3(matModel * vec4(vertexPosition, 1.0));
|
fragPosition = vec3(matModel * vec4(vertexPosition, 1.0));
|
||||||
fragTexCoord = vertexTexCoord;
|
fragTexCoord = vertexTexCoord;
|
||||||
fragColor = vertexColor;
|
fragColor = vertexColor;
|
||||||
|
|
||||||
mat3 normalMatrix = transpose(inverse(mat3(matModel)));
|
mat3 normalMatrix = transpose(inverse(mat3(matModel)));
|
||||||
fragNormal = normalize(normalMatrix * vertexNormal);
|
fragNormal = normalize(normalMatrix * vertexNormal);
|
||||||
|
|
||||||
gl_Position = mvp * vec4(vertexPosition, 1.0);
|
gl_Position = mvp * vec4(vertexPosition, 1.0);
|
||||||
}
|
}
|
||||||
|
|
@ -5,11 +5,11 @@ attribute vec3 vertexNormal;
|
||||||
attribute vec2 vertexTexCoord;
|
attribute vec2 vertexTexCoord;
|
||||||
attribute vec4 vertexColor;
|
attribute vec4 vertexColor;
|
||||||
|
|
||||||
uniform mat4 mvp;
|
uniform mat4 mvp;
|
||||||
uniform float outlineThickness;
|
uniform float outlineThickness;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 extruded = vertexPosition + vertexNormal * outlineThickness;
|
vec3 extruded = vertexPosition + vertexNormal * outlineThickness;
|
||||||
gl_Position = mvp * vec4(extruded, 1.0);
|
gl_Position = mvp * vec4(extruded, 1.0);
|
||||||
}
|
}
|
||||||
|
|
@ -6,13 +6,13 @@ varying vec4 fragColor;
|
||||||
varying vec3 fragNormal;
|
varying vec3 fragNormal;
|
||||||
|
|
||||||
uniform sampler2D texture0;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 colDiffuse;
|
uniform vec4 colDiffuse;
|
||||||
uniform vec3 viewPos;
|
uniform vec3 viewPos;
|
||||||
uniform float numBands;
|
uniform float numBands;
|
||||||
|
|
||||||
struct Light {
|
struct Light {
|
||||||
int enabled;
|
int enabled;
|
||||||
int type;
|
int type;
|
||||||
vec3 position;
|
vec3 position;
|
||||||
vec3 target;
|
vec3 target;
|
||||||
vec4 color;
|
vec4 color;
|
||||||
|
|
@ -21,9 +21,9 @@ uniform Light lights[4];
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 texColor = texture2D(texture0, fragTexCoord);
|
vec4 texColor = texture2D(texture0, fragTexCoord);
|
||||||
vec3 baseColor = texColor.rgb * fragColor.rgb * colDiffuse.rgb;
|
vec3 baseColor = texColor.rgb * fragColor.rgb * colDiffuse.rgb;
|
||||||
vec3 norm = normalize(fragNormal);
|
vec3 norm = normalize(fragNormal);
|
||||||
|
|
||||||
float lightAccum = 0.08; // ambient floor
|
float lightAccum = 0.08; // ambient floor
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@ mat3 inverse(mat3 m)
|
||||||
float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];
|
float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];
|
||||||
float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];
|
float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];
|
||||||
float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];
|
float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];
|
||||||
float b01 = a22*a11 - a12*a21;
|
float b01 = a22*a11 - a12*a21;
|
||||||
float b11 = -a22*a10 + a12*a20;
|
float b11 = -a22*a10 + a12*a20;
|
||||||
float b21 = a21*a10 - a11*a20;
|
float b21 = a21*a10 - a11*a20;
|
||||||
float det = a00*b01 + a01*b11 + a02*b21;
|
float det = a00*b01 + a01*b11 + a02*b21;
|
||||||
return mat3(b01, (-a22*a01 + a02*a21), ( a12*a01 - a02*a11),
|
return mat3(b01, (-a22*a01 + a02*a21), ( a12*a01 - a02*a11),
|
||||||
b11, ( a22*a00 - a02*a20), (-a12*a00 + a02*a10),
|
b11, ( a22*a00 - a02*a20), (-a12*a00 + a02*a10),
|
||||||
|
|
@ -39,10 +39,10 @@ void main()
|
||||||
{
|
{
|
||||||
fragPosition = vec3(matModel * vec4(vertexPosition, 1.0));
|
fragPosition = vec3(matModel * vec4(vertexPosition, 1.0));
|
||||||
fragTexCoord = vertexTexCoord;
|
fragTexCoord = vertexTexCoord;
|
||||||
fragColor = vertexColor;
|
fragColor = vertexColor;
|
||||||
|
|
||||||
mat3 normalMatrix = transpose(inverse(mat3(matModel)));
|
mat3 normalMatrix = transpose(inverse(mat3(matModel)));
|
||||||
fragNormal = normalize(normalMatrix * vertexNormal);
|
fragNormal = normalize(normalMatrix * vertexNormal);
|
||||||
|
|
||||||
gl_Position = mvp * vec4(vertexPosition, 1.0);
|
gl_Position = mvp * vec4(vertexPosition, 1.0);
|
||||||
}
|
}
|
||||||
|
|
@ -5,11 +5,11 @@ attribute vec3 vertexNormal;
|
||||||
attribute vec2 vertexTexCoord;
|
attribute vec2 vertexTexCoord;
|
||||||
attribute vec4 vertexColor;
|
attribute vec4 vertexColor;
|
||||||
|
|
||||||
uniform mat4 mvp;
|
uniform mat4 mvp;
|
||||||
uniform float outlineThickness;
|
uniform float outlineThickness;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 extruded = vertexPosition + vertexNormal * outlineThickness;
|
vec3 extruded = vertexPosition + vertexNormal * outlineThickness;
|
||||||
gl_Position = mvp * vec4(extruded, 1.0);
|
gl_Position = mvp * vec4(extruded, 1.0);
|
||||||
}
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ in vec3 fragNormal;
|
||||||
|
|
||||||
// Raylib standard uniforms
|
// Raylib standard uniforms
|
||||||
uniform sampler2D texture0;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 colDiffuse;
|
uniform vec4 colDiffuse;
|
||||||
|
|
||||||
// View position for future specular / fresnel use.
|
// View position for future specular / fresnel use.
|
||||||
uniform vec3 viewPos;
|
uniform vec3 viewPos;
|
||||||
|
|
@ -18,7 +18,7 @@ uniform float numBands;
|
||||||
// rlights.h compatible light block.
|
// rlights.h compatible light block.
|
||||||
struct Light {
|
struct Light {
|
||||||
int enabled;
|
int enabled;
|
||||||
int type; // 0 = directional, 1 = point
|
int type; // 0 = directional, 1 = point
|
||||||
vec3 position;
|
vec3 position;
|
||||||
vec3 target;
|
vec3 target;
|
||||||
vec4 color;
|
vec4 color;
|
||||||
|
|
@ -29,9 +29,9 @@ uniform Light lights[4];
|
||||||
out vec4 finalColor;
|
out vec4 finalColor;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 texColor = texture(texture0, fragTexCoord);
|
vec4 texColor = texture(texture0, fragTexCoord);
|
||||||
vec3 baseColor = texColor.rgb * fragColor.rgb * colDiffuse.rgb;
|
vec3 baseColor = texColor.rgb * fragColor.rgb * colDiffuse.rgb;
|
||||||
vec3 norm = normalize(fragNormal);
|
vec3 norm = normalize(fragNormal);
|
||||||
|
|
||||||
float lightAccum = 0.08; // ambient floor
|
float lightAccum = 0.08; // ambient floor
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ out vec3 fragNormal;
|
||||||
void main() {
|
void main() {
|
||||||
fragPosition = vec3(matModel * vec4(vertexPosition, 1.0));
|
fragPosition = vec3(matModel * vec4(vertexPosition, 1.0));
|
||||||
fragTexCoord = vertexTexCoord;
|
fragTexCoord = vertexTexCoord;
|
||||||
fragColor = vertexColor;
|
fragColor = vertexColor;
|
||||||
fragNormal = normalize(vec3(matNormal * vec4(vertexNormal, 0.0)));
|
fragNormal = normalize(vec3(matNormal * vec4(vertexNormal, 0.0)));
|
||||||
gl_Position = mvp * vec4(vertexPosition, 1.0);
|
gl_Position = mvp * vec4(vertexPosition, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@ in vec3 vertexNormal;
|
||||||
in vec2 vertexTexCoord;
|
in vec2 vertexTexCoord;
|
||||||
in vec4 vertexColor;
|
in vec4 vertexColor;
|
||||||
|
|
||||||
uniform mat4 mvp;
|
uniform mat4 mvp;
|
||||||
uniform float outlineThickness;
|
uniform float outlineThickness;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
// Extrude vertex along its normal to create the hull.
|
// Extrude vertex along its normal to create the hull.
|
||||||
vec3 extruded = vertexPosition + vertexNormal * outlineThickness;
|
vec3 extruded = vertexPosition + vertexNormal * outlineThickness;
|
||||||
gl_Position = mvp * vec4(extruded, 1.0);
|
gl_Position = mvp * vec4(extruded, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user