mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
style
This commit is contained in:
@@ -8,15 +8,15 @@ uniform bool horizontal;
|
|||||||
uniform sampler2D tex;
|
uniform sampler2D tex;
|
||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
int amount=5;
|
int amount = 5;
|
||||||
float weight[5] = float[] (0.227027, 0.1945946, 0.1216216, 0.054054,0.016216);
|
float weight[5] = float[] (0.227027, 0.1945946, 0.1216216, 0.054054,0.016216);
|
||||||
vec2 texel=1.0/textureSize(tex,0);
|
vec2 texel = 1.0 / textureSize(tex, 0);
|
||||||
vec3 c=texture(tex,texCoords).rgb*weight[0];
|
vec3 c = texture(tex, texCoords).rgb * weight[0];
|
||||||
|
|
||||||
for(int i=1;i<amount;i++){
|
for(int i = 1; i < amount; i++){
|
||||||
vec2 offset=vec2(horizontal?texel.x:0,horizontal?0:texel.y);
|
vec2 offset = vec2(horizontal ? texel.x : 0, horizontal ? 0 : texel.y);
|
||||||
c+=texture(tex,texCoords+offset*i).rgb*weight[i];
|
c += texture(tex, texCoords + offset * i).rgb * weight[i];
|
||||||
c+=texture(tex,texCoords-offset*i).rgb*weight[i];
|
c += texture(tex, texCoords - offset * i).rgb * weight[i];
|
||||||
}
|
}
|
||||||
FragColor=vec4(c,1);
|
FragColor = vec4(c, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
#version 330 core
|
#version 330 core
|
||||||
|
|
||||||
layout (location=0) in vec3 aVert;
|
layout (location = 0) in vec3 aVert;
|
||||||
layout (location=2) in vec2 aTexCoords;
|
layout (location = 2) in vec2 aTexCoords;
|
||||||
|
|
||||||
out vec2 texCoords;
|
out vec2 texCoords;
|
||||||
|
|
||||||
uniform vec2 screen;
|
uniform vec2 screen;
|
||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
float x,y;
|
float x, y;
|
||||||
x=(aVert.x-screen.x*.5)/(screen.x*.5);
|
x = (aVert.x - screen.x * .5) / (screen.x * .5);
|
||||||
y=(screen.y*.5-aVert.y)/(screen.y*.5);
|
y = (screen.y * .5 - aVert.y) / (screen.y * .5);
|
||||||
gl_Position=vec4(x,y,aVert.z,1);
|
gl_Position = vec4(x, y, aVert.z, 1);
|
||||||
texCoords=aTexCoords;
|
texCoords = aTexCoords;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -8,8 +8,8 @@ in vec4 fragPos;
|
|||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
if(point){
|
if(point){
|
||||||
float dist=length(lightPos-fragPos.xyz);
|
float dist = length(lightPos - fragPos.xyz);
|
||||||
dist/=farPlane;
|
dist /= farPlane;
|
||||||
gl_FragDepth=dist;
|
gl_FragDepth = dist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -1,7 +1,7 @@
|
|||||||
#version 330 core
|
#version 330 core
|
||||||
|
|
||||||
layout (triangles) in;
|
layout (triangles) in;
|
||||||
layout (triangle_strip, max_vertices=18) out;
|
layout (triangle_strip, max_vertices = 18) out;
|
||||||
|
|
||||||
out vec4 fragPos;
|
out vec4 fragPos;
|
||||||
|
|
||||||
@@ -10,11 +10,11 @@ uniform bool point;
|
|||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
if(point)
|
if(point)
|
||||||
for(int i=0;i<6;i++){
|
for(int i = 0; i < 6; i++){
|
||||||
gl_Layer=i;
|
gl_Layer = i;
|
||||||
for(int j=0;j<3;j++){
|
for(int j = 0; j < 3; j++){
|
||||||
fragPos=gl_in[j].gl_Position;
|
fragPos = gl_in[j].gl_Position;
|
||||||
gl_Position=shadowMat[i]*fragPos;
|
gl_Position = shadowMat[i] * fragPos;
|
||||||
EmitVertex();
|
EmitVertex();
|
||||||
}
|
}
|
||||||
EndPrimitive();
|
EndPrimitive();
|
||||||
|
|||||||
+4
-5
@@ -1,14 +1,13 @@
|
|||||||
#version 330 core
|
#version 330 core
|
||||||
|
|
||||||
layout (location=0) in vec3 aPos;
|
layout (location = 0) in vec3 aPos;
|
||||||
|
|
||||||
uniform mat4 model;
|
uniform mat4 model, lightMat;
|
||||||
uniform mat4 lightMat;
|
|
||||||
uniform bool point;
|
uniform bool point;
|
||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
if(point)
|
if(point)
|
||||||
gl_Position=model*vec4(aPos,1);
|
gl_Position = model * vec4(aPos, 1);
|
||||||
else
|
else
|
||||||
gl_Position=lightMat*model*vec4(aPos,1);
|
gl_Position = lightMat * model * vec4(aPos, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-14
@@ -4,29 +4,26 @@ in vec2 texCoords;
|
|||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
|
|
||||||
uniform sampler2D frag;
|
uniform sampler2D frag, bright;
|
||||||
uniform sampler2D bright;
|
uniform bool hdr, bloom;
|
||||||
uniform bool hdr;
|
uniform float exposure, gamma;
|
||||||
uniform bool bloom;
|
|
||||||
uniform float exposure;
|
|
||||||
uniform float gamma;
|
|
||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
vec4 hdrColor=texture(frag,texCoords);
|
vec4 hdrColor = texture(frag, texCoords);
|
||||||
vec4 brightColor=texture(bright,texCoords);
|
vec4 brightColor = texture(bright, texCoords);
|
||||||
vec2 texel=1.0/textureSize(bright,0);
|
vec2 texel = 1.0 / textureSize(bright, 0);
|
||||||
|
|
||||||
if(bloom)
|
if(bloom)
|
||||||
hdrColor+=brightColor;
|
hdrColor += brightColor;
|
||||||
|
|
||||||
if(hdr){
|
if(hdr){
|
||||||
//Reinhardt
|
//Reinhardt
|
||||||
//c.rgb=c.rgb/(c.rgb+vec3(1.));
|
//c.rgb = c.rgb / (c.rgb + vec3(1.));
|
||||||
|
|
||||||
//Exp
|
//Exp
|
||||||
hdrColor.rgb=vec3(1.)-exp(-hdrColor.rgb*exposure);
|
hdrColor.rgb = vec3(1.) - exp(-hdrColor.rgb * exposure);
|
||||||
}
|
}
|
||||||
|
|
||||||
hdrColor.rgb=pow(hdrColor.rgb,vec3(1/gamma));
|
hdrColor.rgb = pow(hdrColor.rgb, vec3(1 / gamma));
|
||||||
FragColor=hdrColor;
|
FragColor = hdrColor;
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -1,16 +1,16 @@
|
|||||||
#version 330 core
|
#version 330 core
|
||||||
|
|
||||||
layout (location=0) in vec3 aVert;
|
layout (location = 0) in vec3 aVert;
|
||||||
layout (location=2) in vec2 aTexCoords;
|
layout (location = 2) in vec2 aTexCoords;
|
||||||
|
|
||||||
out vec2 texCoords;
|
out vec2 texCoords;
|
||||||
|
|
||||||
uniform vec2 screen;
|
uniform vec2 screen;
|
||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
float x,y;
|
float x, y;
|
||||||
x=(aVert.x-screen.x*.5)/(screen.x*.5);
|
x = (aVert.x - screen.x * .5) / (screen.x * .5);
|
||||||
y=(screen.y*.5-aVert.y)/(screen.y*.5);
|
y = (screen.y * .5-aVert.y) / (screen.y * .5);
|
||||||
gl_Position=vec4(x,y,aVert.z,1);
|
gl_Position = vec4(x, y, aVert.z, 1);
|
||||||
texCoords=aTexCoords;
|
texCoords = aTexCoords;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
in vec3 texCoords;
|
in vec3 texCoords;
|
||||||
|
|
||||||
layout (location=0) out vec4 FragColor;
|
layout (location = 0) out vec4 FragColor;
|
||||||
layout (location=1) out vec4 BrightColor;
|
layout (location = 1) out vec4 BrightColor;
|
||||||
|
|
||||||
uniform samplerCube skybox;
|
uniform samplerCube skybox;
|
||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
BrightColor=vec4(0);
|
BrightColor = vec4(0);
|
||||||
FragColor=texture(skybox,texCoords);
|
FragColor = texture(skybox, texCoords);
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-6
@@ -1,14 +1,13 @@
|
|||||||
#version 330 core
|
#version 330 core
|
||||||
|
|
||||||
layout (location=0) in vec3 aPos;
|
layout (location = 0) in vec3 aPos;
|
||||||
|
|
||||||
out vec3 texCoords;
|
out vec3 texCoords;
|
||||||
|
|
||||||
uniform mat4 proj;
|
uniform mat4 proj, view;
|
||||||
uniform mat4 view;
|
|
||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
texCoords=aPos;
|
texCoords = aPos;
|
||||||
vec4 pos=proj*view*vec4(aPos,1);
|
vec4 pos = proj * view * vec4(aPos, 1);
|
||||||
gl_Position=pos;
|
gl_Position = pos;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#version 330 core
|
#version 330 core
|
||||||
|
|
||||||
layout (location=0) in vec4 aVert;
|
layout (location = 0) in vec4 aVert;
|
||||||
|
|
||||||
out vec2 texCoords;
|
out vec2 texCoords;
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -3,7 +3,7 @@
|
|||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
layout (triangles) in;
|
layout (triangles) in;
|
||||||
layout (triangle_strip, max_vertices=3) out;
|
layout (triangle_strip, max_vertices = 3) out;
|
||||||
|
|
||||||
in VS_OUT{
|
in VS_OUT{
|
||||||
vec2 tCoords;
|
vec2 tCoords;
|
||||||
@@ -18,24 +18,24 @@ uniform bool environment;
|
|||||||
void main(){
|
void main(){
|
||||||
/*
|
/*
|
||||||
if(environment)
|
if(environment)
|
||||||
for(int i=0;i<6;i++){
|
for(int i = 0; i < 6; i++){
|
||||||
gl_Layer=i;
|
gl_Layer = i;
|
||||||
for(int j=0;j<3;j++){
|
for(int j = 0; j < 3; j++){
|
||||||
FragPos=gl_in[j].gl_Position;
|
FragPos = gl_in[j].gl_Position;
|
||||||
gl_Position=shadowMat[i]*FragPos;
|
gl_Position = shadowMat[i] * FragPos;
|
||||||
EmitVertex();
|
EmitVertex();
|
||||||
}
|
}
|
||||||
EndPrimitive();
|
EndPrimitive();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
gl_Position=gl_in[0].gl_Position;
|
gl_Position = gl_in[0].gl_Position;
|
||||||
texCoords=gs_in[0].tCoords;
|
texCoords = gs_in[0].tCoords;
|
||||||
EmitVertex();
|
EmitVertex();
|
||||||
gl_Position=gl_in[1].gl_Position;
|
gl_Position = gl_in[1].gl_Position;
|
||||||
texCoords=gs_in[1].tCoords;
|
texCoords = gs_in[1].tCoords;
|
||||||
EmitVertex();
|
EmitVertex();
|
||||||
gl_Position=gl_in[2].gl_Position;
|
gl_Position = gl_in[2].gl_Position;
|
||||||
texCoords=gs_in[2].tCoords;
|
texCoords = gs_in[2].tCoords;
|
||||||
EmitVertex();
|
EmitVertex();
|
||||||
EndPrimitive();
|
EndPrimitive();
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-12
@@ -8,19 +8,16 @@ const int numShapeKeys = 1;
|
|||||||
mat4 transform[numBones];
|
mat4 transform[numBones];
|
||||||
mat4 poseTransform[numBones];
|
mat4 poseTransform[numBones];
|
||||||
|
|
||||||
layout (location=0) in vec3 aPos;
|
layout (location = 0) in vec3 aPos;
|
||||||
layout (location=1) in vec3 aNorm;
|
layout (location = 1) in vec3 aNorm;
|
||||||
layout (location=2) in vec2 aTexCoords;
|
layout (location = 2) in vec2 aTexCoords;
|
||||||
layout (location=3) in vec3 aTan;
|
layout (location = 3) in vec3 aTan;
|
||||||
layout (location=4) in vec3 aBiTan;
|
layout (location = 4) in vec3 aBiTan;
|
||||||
layout (location=5) in vec4 aWeight;
|
layout (location = 5) in vec4 aWeight;
|
||||||
layout (location=6) in ivec4 aBoneIndices;
|
layout (location = 6) in ivec4 aBoneIndices;
|
||||||
layout (location=7) in vec3 aShapeKeyOffsets[numShapeKeys];
|
layout (location = 7) in vec3 aShapeKeyOffsets[numShapeKeys];
|
||||||
|
|
||||||
out vec3 fragPos;
|
out vec3 fragPos, norm, tan, biTan;
|
||||||
out vec3 norm;
|
|
||||||
out vec3 tan;
|
|
||||||
out vec3 biTan;
|
|
||||||
out vec2 texCoords;
|
out vec2 texCoords;
|
||||||
|
|
||||||
struct Bone{
|
struct Bone{
|
||||||
|
|||||||
Reference in New Issue
Block a user