mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-22 00:37:35 +08:00
intial changes for commit #495
This commit is contained in:
5
shaders/world0/dh_generic.fsh
Normal file
5
shaders/world0/dh_generic.fsh
Normal file
@ -0,0 +1,5 @@
|
||||
#version 330 compatibility
|
||||
|
||||
#define OVERWORLD_SHADER
|
||||
|
||||
#include "/dimensions/DH_generic.fsh"
|
5
shaders/world0/dh_generic.vsh
Normal file
5
shaders/world0/dh_generic.vsh
Normal file
@ -0,0 +1,5 @@
|
||||
#version 330 compatibility
|
||||
|
||||
#define OVERWORLD_SHADER
|
||||
|
||||
#include "/dimensions/DH_generic.vsh"
|
@ -20,7 +20,16 @@ float blueNoise(){
|
||||
|
||||
|
||||
void main() {
|
||||
gl_FragData[0] = vec4(texture2D(tex,texcoord.xy).rgb * color.rgb, texture2DLod(tex, texcoord.xy, 0).a);
|
||||
|
||||
vec4 shadowColor = vec4(texture2D(tex,texcoord.xy).rgb * color.rgb, texture2DLod(tex, texcoord.xy, 0).a);
|
||||
|
||||
#ifdef TRANSLUCENT_COLORED_SHADOWS
|
||||
if(shadowColor.a > 0.9999) shadowColor.rgb = vec3(0.0);
|
||||
#endif
|
||||
|
||||
gl_FragData[0] = shadowColor;
|
||||
|
||||
// gl_FragData[0] = vec4(texture2D(tex,texcoord.xy).rgb * color.rgb, texture2DLod(tex, texcoord.xy, 0).a);
|
||||
|
||||
#ifdef Stochastic_Transparent_Shadows
|
||||
if(gl_FragData[0].a < blueNoise()) { discard; return;}
|
||||
|
@ -146,6 +146,8 @@ void main() {
|
||||
color = gl_Color;
|
||||
|
||||
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
|
||||
|
||||
|
||||
// playerpos = vec4(0.0);
|
||||
// playerpos = gbufferModelViewInverse * (gl_ModelViewMatrix * gl_Vertex);
|
||||
|
||||
@ -196,9 +198,9 @@ void main() {
|
||||
// }
|
||||
// #endif
|
||||
|
||||
#if defined IS_LPV_ENABLED || defined WAVY_PLANTS
|
||||
// #if defined IS_LPV_ENABLED || defined WAVY_PLANTS || !defined PLANET_CURVATURE
|
||||
vec3 playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
|
||||
#endif
|
||||
// #endif
|
||||
|
||||
#if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store
|
||||
PopulateShadowVoxel(playerpos);
|
||||
@ -225,6 +227,7 @@ void main() {
|
||||
|
||||
int blockId = int(mc_Entity.x + 0.5);
|
||||
|
||||
vec3 worldpos = playerpos;
|
||||
#ifdef WAVY_PLANTS
|
||||
// also use normal, so up/down facing geometry does not get detatched from its model parts.
|
||||
bool InterpolateFromBase = gl_MultiTexCoord0.t < max(mc_midTexCoord.t, abs(viewToWorld(normalize(gl_NormalMatrix * gl_Normal)).y));
|
||||
@ -242,7 +245,6 @@ void main() {
|
||||
|
||||
) && length(position.xy) < 24.0
|
||||
){
|
||||
vec3 worldpos = playerpos;
|
||||
|
||||
// apply displacement for waving plant blocks
|
||||
worldpos += calcMovePlants(playerpos + cameraPosition) * max(gl_MultiTexCoord1.y,0.5);
|
||||
@ -250,11 +252,16 @@ void main() {
|
||||
// apply displacement for waving leaf blocks specifically, overwriting the other waving mode. these wave off of the air. they wave uniformly
|
||||
if(blockId == BLOCK_AIR_WAVING) worldpos = playerpos + calcMoveLeaves(playerpos + cameraPosition, 0.0040, 0.0064, 0.0043, 0.0035, 0.0037, 0.0041, vec3(1.0,0.2,1.0), vec3(0.5,0.1,0.5))*gl_MultiTexCoord1.y;
|
||||
|
||||
position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PLANET_CURVATURE
|
||||
float curvature = length(worldpos) / (16*8);
|
||||
worldpos.y -= curvature*curvature * CURVATURE_AMOUNT;
|
||||
#endif
|
||||
|
||||
position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz;
|
||||
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
if (entityId == ENTITY_SSS_MEDIUM || entityId == ENTITY_SLIME)
|
||||
position.xyz = position.xyz - normalize(gl_NormalMatrix * gl_Normal) * 0.25;
|
||||
|
Reference in New Issue
Block a user