mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2024-12-23 01:59:39 +08:00
Refraction fix
fix the refraction. hopefully.
This commit is contained in:
parent
52466e8e35
commit
82668ef211
@ -194,9 +194,14 @@ void main() {
|
|||||||
vec4 unpack0 = vec4(decodeVec2(data.r),decodeVec2(data.g)) ;
|
vec4 unpack0 = vec4(decodeVec2(data.r),decodeVec2(data.g)) ;
|
||||||
vec4 unpack1 = vec4(decodeVec2(data.b),0,0) ;
|
vec4 unpack1 = vec4(decodeVec2(data.b),0,0) ;
|
||||||
|
|
||||||
vec2 tangentNormals = unpack0.xy*2.0-1.0;
|
|
||||||
|
|
||||||
vec4 albedo = vec4(unpack0.ba,unpack1.rg);
|
vec4 albedo = vec4(unpack0.ba,unpack1.rg);
|
||||||
|
|
||||||
|
vec2 tangentNormals = unpack0.xy*2.0-1.0;
|
||||||
|
|
||||||
|
if(albedo.a <= 0.0) tangentNormals = vec2(0.0);
|
||||||
|
|
||||||
vec4 TranslucentShader = texture2D(colortex2,texcoord);
|
vec4 TranslucentShader = texture2D(colortex2,texcoord);
|
||||||
|
|
||||||
float lightleakfix = clamp((eyeBrightnessSmooth.y )/240.0,0.0,1.0);
|
float lightleakfix = clamp((eyeBrightnessSmooth.y )/240.0,0.0,1.0);
|
||||||
@ -213,9 +218,12 @@ void main() {
|
|||||||
|
|
||||||
/// --- REFRACTION --- ///
|
/// --- REFRACTION --- ///
|
||||||
#ifdef Refraction
|
#ifdef Refraction
|
||||||
refractedCoord += (tangentNormals * clamp((ld(z2) - ld(z)) * 0.5,0.0,0.15)) * RENDER_SCALE;
|
// refractedCoord += (tangentNormals * clamp((ld(z2) - ld(z)) * 0.5,0.0,0.15)) * RENDER_SCALE;
|
||||||
|
refractedCoord += tangentNormals * 0.1 * RENDER_SCALE;
|
||||||
|
|
||||||
if( texture2D(colortex7,refractedCoord).a < 0.95 && decodeVec2(texture2D(colortex11,refractedCoord).b).g < 0.01 ) refractedCoord = texcoord; // remove refracted coords on solids
|
float refractedalpha = decodeVec2(texture2D(colortex11,refractedCoord).b).g;
|
||||||
|
float refractedalpha2 = texture2D(colortex7,refractedCoord).a;
|
||||||
|
if( refractedalpha <= 0.0 ) refractedCoord = texcoord; // remove refracted coords on solids
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// --- MAIN COLOR BUFFER --- ///
|
/// --- MAIN COLOR BUFFER --- ///
|
||||||
@ -297,7 +305,7 @@ void main() {
|
|||||||
|
|
||||||
gl_FragData[1].rgb = clamp(color.rgb,0.0,68000.0);
|
gl_FragData[1].rgb = clamp(color.rgb,0.0,68000.0);
|
||||||
|
|
||||||
// gl_FragData[1].rgb = vec3(albedo.rgb*albedo.a);
|
// gl_FragData[1].rgb = vec3(albedo.a);
|
||||||
// if(texcoord.x > 0.5) gl_FragData[1].rgb = vec3(tangentNormals,0.0);
|
// gl_FragData[1].rgb = vec3(tangentNormals,0.0);
|
||||||
|
|
||||||
}
|
}
|
@ -8,7 +8,7 @@ entity.1100 = slime giant ender_dragon ghast
|
|||||||
#weak sss (same as weak sss for blocks)
|
#weak sss (same as weak sss for blocks)
|
||||||
entity.1200 = player frog sheep chicken snow_golem polar_bear zombie_horse armor_stand arrow squid bat cat cod cow donkey fox horse mooshroom mule ocelot parrot pig piglin polar_bear pufferfish rabbit salmon strider tropical_fish turtle villager wandering_trader bee cave_spider dolphin enderman llama panda spider wolf zombified_piglin blaze creeper drowned elder_gaurdian endermite evoker guardian hoglin husk magma_cube phantom piglin_brute pillager ravager silverfish stray vex vindicator witch zoglin zombie zombie_villager wither trader_llama
|
entity.1200 = player frog sheep chicken snow_golem polar_bear zombie_horse armor_stand arrow squid bat cat cod cow donkey fox horse mooshroom mule ocelot parrot pig piglin polar_bear pufferfish rabbit salmon strider tropical_fish turtle villager wandering_trader bee cave_spider dolphin enderman llama panda spider wolf zombified_piglin blaze creeper drowned elder_gaurdian endermite evoker guardian hoglin husk magma_cube phantom piglin_brute pillager ravager silverfish stray vex vindicator witch zoglin zombie zombie_villager wither trader_llama
|
||||||
|
|
||||||
entity.5000 = lightning_bolt
|
entity.12345=minecraft:lightning_bolt
|
||||||
|
|
||||||
|
|
||||||
# entity.9001 = minecraft:boat
|
# entity.9001 = minecraft:boat
|
||||||
|
@ -310,9 +310,9 @@ void main() {
|
|||||||
#endif
|
#endif
|
||||||
vec3 coord = vec3(vtexcoord.st, 1.0);
|
vec3 coord = vec3(vtexcoord.st, 1.0);
|
||||||
|
|
||||||
coord += (interval * noise) * used_POM_DEPTH;
|
coord += (interval ) * used_POM_DEPTH;
|
||||||
|
|
||||||
float sumVec = noise;
|
float sumVec = 0.5;
|
||||||
for (int loopCount = 0; (loopCount < MAX_OCCLUSION_POINTS) && (1.0 - POM_DEPTH + POM_DEPTH * readNormal(coord.st).a ) < coord.p && coord.p >= 0.0; ++loopCount) {
|
for (int loopCount = 0; (loopCount < MAX_OCCLUSION_POINTS) && (1.0 - POM_DEPTH + POM_DEPTH * readNormal(coord.st).a ) < coord.p && coord.p >= 0.0; ++loopCount) {
|
||||||
coord = coord+interval * used_POM_DEPTH;
|
coord = coord+interval * used_POM_DEPTH;
|
||||||
sumVec += 1.0 * used_POM_DEPTH;
|
sumVec += 1.0 * used_POM_DEPTH;
|
||||||
@ -340,6 +340,7 @@ void main() {
|
|||||||
|
|
||||||
vec4 Albedo = texture2DGradARB(texture, adjustedTexCoord.xy, dcdx,dcdy) * color;
|
vec4 Albedo = texture2DGradARB(texture, adjustedTexCoord.xy, dcdx,dcdy) * color;
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENTITIES
|
#ifdef ENTITIES
|
||||||
if(NameTags == 1) Albedo = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias) * color;
|
if(NameTags == 1) Albedo = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias) * color;
|
||||||
#endif
|
#endif
|
||||||
@ -398,9 +399,9 @@ void main() {
|
|||||||
|
|
||||||
normal = applyBump(tbnMatrix,NormalTex, mix(1.0,Puddle_shape,rainfall));
|
normal = applyBump(tbnMatrix,NormalTex, mix(1.0,Puddle_shape,rainfall));
|
||||||
|
|
||||||
#ifdef ENTITIES
|
// #ifdef ENTITIES
|
||||||
if(NameTags == 1) normal = vec3(1);
|
// if(NameTags == 1) normal = vec3(1);
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
@ -433,9 +434,9 @@ void main() {
|
|||||||
|
|
||||||
normal = applyBump(tbnMatrix, NormalTex.xyz, 1 );
|
normal = applyBump(tbnMatrix, NormalTex.xyz, 1 );
|
||||||
|
|
||||||
#ifdef ENTITIES
|
// #ifdef ENTITIES
|
||||||
if(NameTags == 1) normal = vec3(1);
|
// if(NameTags == 1) normal = vec3(1);
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef ENTITY_PHYSICSMOD_SNOW
|
// #ifdef ENTITY_PHYSICSMOD_SNOW
|
||||||
// normal = FlatNormals;
|
// normal = FlatNormals;
|
||||||
|
@ -270,6 +270,8 @@ if (gl_FragCoord.x * texelSize.x < RENDER_SCALE.x && gl_FragCoord.y * texelSize
|
|||||||
gl_FragData[0] = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias) * color;
|
gl_FragData[0] = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias) * color;
|
||||||
vec3 Albedo = toLinear(gl_FragData[0].rgb);
|
vec3 Albedo = toLinear(gl_FragData[0].rgb);
|
||||||
|
|
||||||
|
float UnchangedAlpha = gl_FragData[0].a;
|
||||||
|
|
||||||
float iswater = normalMat.w;
|
float iswater = normalMat.w;
|
||||||
|
|
||||||
#ifdef HAND
|
#ifdef HAND
|
||||||
@ -291,7 +293,7 @@ if (gl_FragCoord.x * texelSize.x < RENDER_SCALE.x && gl_FragCoord.y * texelSize
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
vec4 COLORTEST = vec4(Albedo,gl_FragData[0].a);
|
vec4 COLORTEST = vec4(Albedo,UnchangedAlpha);
|
||||||
|
|
||||||
|
|
||||||
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
|
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
|
||||||
@ -356,7 +358,7 @@ if (gl_FragCoord.x * texelSize.x < RENDER_SCALE.x && gl_FragCoord.y * texelSize
|
|||||||
}
|
}
|
||||||
|
|
||||||
// cannot encode alpha or it will shit its pants
|
// cannot encode alpha or it will shit its pants
|
||||||
gl_FragData[2] = vec4(encodeVec2(TangentNormal), encodeVec2(COLORTEST.rg), encodeVec2(COLORTEST.ba), 1.0);
|
gl_FragData[2] = vec4(encodeVec2(TangentNormal), encodeVec2(COLORTEST.rg), encodeVec2(COLORTEST.ba), UnchangedAlpha);
|
||||||
|
|
||||||
|
|
||||||
float NdotL = clamp(lightSign*dot(normal,sunVec) ,0.0,1.0);
|
float NdotL = clamp(lightSign*dot(normal,sunVec) ,0.0,1.0);
|
||||||
|
@ -44,5 +44,5 @@ float stars(vec3 fragpos){
|
|||||||
float elevation = clamp(fragpos.y,0.,1.);
|
float elevation = clamp(fragpos.y,0.,1.);
|
||||||
vec2 uv = fragpos.xz/(1.5+elevation);
|
vec2 uv = fragpos.xz/(1.5+elevation);
|
||||||
|
|
||||||
return StableStarField(uv*1500.,0.999)*0.5*(0.3-0.3*rainStrength);
|
return StableStarField(uv*1000.,0.999)*0.5*(0.3-0.3*rainStrength);
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,8 @@ blend.gbuffers_basic= off
|
|||||||
blend.gbuffers_damagedblock= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
|
blend.gbuffers_damagedblock= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
|
||||||
blend.gbuffers_skytextured=off
|
blend.gbuffers_skytextured=off
|
||||||
|
|
||||||
|
blend.gbuffers_water.colortex11 = off
|
||||||
|
|
||||||
alphaTest.gbuffers_armor_glint=false
|
alphaTest.gbuffers_armor_glint=false
|
||||||
alphaTest.gbuffers_entities=GREATER 0.1
|
alphaTest.gbuffers_entities=GREATER 0.1
|
||||||
alphaTest.gbuffers_weather=false
|
alphaTest.gbuffers_weather=false
|
||||||
|
Loading…
Reference in New Issue
Block a user