mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-22 08:42:50 +08:00
FIX stochastic shadows on IRIS. add filter option for SSAO and all SSS types. imrpove fog upsampling (even when DH is being used). ambient light is more consistent across all types of weather. tweak cloud lighting.
This commit is contained in:
@ -16,10 +16,11 @@ flat varying vec4 lightCol;
|
||||
varying mat4 normalmatrix;
|
||||
|
||||
uniform mat4 gbufferModelViewInverse;
|
||||
uniform mat4 gbufferModelView;
|
||||
|
||||
flat varying vec3 WsunVec;
|
||||
flat varying vec3 WsunVec2;
|
||||
|
||||
uniform mat4 dhProjection;
|
||||
uniform vec3 sunPosition;
|
||||
uniform float sunElevation;
|
||||
|
||||
@ -34,17 +35,36 @@ const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
||||
vec2(-7.,-1.)/8.,
|
||||
vec2(3,7.)/8.,
|
||||
vec2(7.,-7.)/8.);
|
||||
|
||||
|
||||
|
||||
uniform vec3 cameraPosition;
|
||||
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
|
||||
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
|
||||
vec4 toClipSpace3(vec3 viewSpacePosition) {
|
||||
return vec4(projMAD(dhProjection, viewSpacePosition),-viewSpacePosition.z);
|
||||
}
|
||||
|
||||
void main() {
|
||||
gl_Position = ftransform();
|
||||
|
||||
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
|
||||
|
||||
pos = gl_ModelViewMatrix * gl_Vertex;
|
||||
|
||||
|
||||
isWater = 0;
|
||||
if (dhMaterialId == DH_BLOCK_WATER){
|
||||
isWater = 1;
|
||||
gl_Position.y -= 6.0/16.0;
|
||||
gl_Position.z -= 1e-4;
|
||||
|
||||
// offset water to not look like a full cube
|
||||
vec3 worldpos = mat3(gbufferModelViewInverse) * position + gbufferModelViewInverse[3].xyz ;
|
||||
worldpos.y -= 1.8/16.0;
|
||||
position = mat3(gbufferModelView) * worldpos + gbufferModelView[3].xyz;
|
||||
|
||||
}
|
||||
|
||||
gl_Position = toClipSpace3(position);
|
||||
|
||||
normals_and_materials = vec4(normalize(gl_Normal), 1.0);
|
||||
|
||||
gcolor = gl_Color;
|
||||
@ -73,5 +93,4 @@ void main() {
|
||||
gl_Position.xy += offsets[framemod8] * gl_Position.w*texelSize;
|
||||
#endif
|
||||
|
||||
pos = gl_ModelViewMatrix * gl_Vertex;
|
||||
}
|
Reference in New Issue
Block a user