mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-22 08:42:50 +08:00
add iris's TRANSLUCENT ENTITIES programs. potentially fix error in end/nether on intel ARC
This commit is contained in:
@ -397,7 +397,7 @@ void main() {
|
||||
//////////////////////////////// ////////////////////////////////
|
||||
|
||||
vec4 Albedo = texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM) * color;
|
||||
|
||||
|
||||
#if defined HAND
|
||||
if (Albedo.a < 0.1) discard;
|
||||
#endif
|
||||
|
@ -186,9 +186,9 @@ void main() {
|
||||
|
||||
gl_Position = ftransform();
|
||||
|
||||
|
||||
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
|
||||
|
||||
|
||||
/////// ----- COLOR STUFF ----- ///////
|
||||
color = gl_Color;
|
||||
|
||||
@ -239,6 +239,7 @@ void main() {
|
||||
#endif
|
||||
|
||||
NameTags = 0;
|
||||
|
||||
|
||||
#ifdef ENTITIES
|
||||
// disallow POM to work on item frames.
|
||||
|
@ -15,6 +15,11 @@ varying vec4 color;
|
||||
flat varying vec4 lightCol;
|
||||
#endif
|
||||
|
||||
#ifdef ENTITIES
|
||||
#undef WATER_BACKGROUND_SPECULAR
|
||||
#undef SCREENSPACE_REFLECTIONS
|
||||
#endif
|
||||
|
||||
flat varying float HELD_ITEM_BRIGHTNESS;
|
||||
|
||||
const bool colortex4MipmapEnabled = true;
|
||||
@ -293,6 +298,8 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
////////////////////////////////
|
||||
|
||||
gl_FragData[0] = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias) * color;
|
||||
|
||||
|
||||
vec3 Albedo = toLinear(gl_FragData[0].rgb);
|
||||
float UnchangedAlpha = gl_FragData[0].a;
|
||||
|
||||
@ -549,7 +556,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
if(isEyeInWater == 1) SkyReflection = vec3(0.0);
|
||||
#endif
|
||||
#else
|
||||
#ifdef WATER_BACKGROUND_SPECULAR
|
||||
#ifdef WATER_BACKGROUND_SPECULAR
|
||||
SkyReflection = skyCloudsFromTexLOD2(mat3(gbufferModelViewInverse) * reflectedVector, colortex4, 0).rgb / 30.0;
|
||||
if(isEyeInWater == 1) SkyReflection = vec3(0.0);
|
||||
#endif
|
||||
@ -571,16 +578,23 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
|
||||
float visibilityFactor = clamp(exp2((pow(roughness,3.0) / f0) * -4),0,1);
|
||||
|
||||
Reflections_Final = mix(SkyReflection*indoors, Reflections.rgb, Reflections.a);
|
||||
Reflections_Final = mix(FinalColor, Reflections_Final, fresnel);
|
||||
#ifdef ENTITIES
|
||||
Reflections_Final = FinalColor;
|
||||
#else
|
||||
Reflections_Final = mix(SkyReflection*indoors, Reflections.rgb, Reflections.a);
|
||||
Reflections_Final = mix(FinalColor, Reflections_Final, fresnel);
|
||||
#endif
|
||||
|
||||
Reflections_Final += SunReflection;
|
||||
|
||||
|
||||
gl_FragData[0].rgb = Reflections_Final;
|
||||
|
||||
//correct alpha channel with fresnel
|
||||
gl_FragData[0].a = mix(gl_FragData[0].a, 1.0, fresnel);
|
||||
|
||||
#ifndef ENTITIES
|
||||
//correct alpha channel with fresnel
|
||||
gl_FragData[0].a = mix(gl_FragData[0].a, 1.0, fresnel);
|
||||
#endif
|
||||
|
||||
if (gl_FragData[0].r > 65000.) gl_FragData[0].rgba = vec4(0.);
|
||||
|
||||
} else {
|
||||
|
@ -105,7 +105,7 @@ void main() {
|
||||
if (mc_Entity.x == 72) mat = 0.5;
|
||||
|
||||
#ifdef ENTITIES
|
||||
mat = 0.2;
|
||||
mat = 0.1;
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1059,7 +1059,5 @@ void main() {
|
||||
}
|
||||
#endif
|
||||
|
||||
// gl_FragData[0].rgb = skyCloudsFromTexLOD2(feetPlayerPos_normalized, colortex12, 6).rgb/30;
|
||||
|
||||
/* DRAWBUFFERS:3 */
|
||||
}
|
@ -20,9 +20,9 @@ uniform float sunElevation;
|
||||
uniform int frameCounter;
|
||||
uniform float frameTimeCounter;
|
||||
|
||||
varying vec2 texcoord;
|
||||
// varying vec2 texcoord;
|
||||
uniform vec2 texelSize;
|
||||
flat varying vec2 TAA_Offset;
|
||||
// flat varying vec2 TAA_Offset;
|
||||
|
||||
uniform int isEyeInWater;
|
||||
uniform float rainStrength;
|
||||
@ -284,7 +284,7 @@ void main() {
|
||||
waterVolumetrics(vl, vec3(0.0), viewPos, estEyeDepth, estEyeDepth, length(viewPos), noise_1, totEpsilon, scatterCoef, ambientColVol, lightColVol*(1.0-pow(1.0-sunElevation*lightCol.a,5.0)) , dot(normalize(viewPos), normalize(sunVec* lightCol.a ) ));
|
||||
gl_FragData[0] = clamp(vec4(vl,1.0),0.000001,65000.);
|
||||
#else
|
||||
vec3 fragpos0 = toScreenSpace(vec3(texcoord - TAA_Offset*texelSize*0.5,z));
|
||||
vec3 fragpos0 = toScreenSpace(vec3(tc,z));
|
||||
vec3 ambientColVol = max(vec3(1.0,0.5,1.0) * 0.6, vec3(0.2,0.4,1.0) * MIN_LIGHT_AMOUNT*0.01);
|
||||
gl_FragData[0].a = 1;
|
||||
waterVolumetrics_notoverworld(gl_FragData[0].rgb, fragpos0, viewPos, 1.0, 1.0, 1.0, blueNoise(), totEpsilon, scatterCoef, ambientColVol);
|
||||
|
@ -179,12 +179,13 @@ void applyContrast(inout vec3 color, float contrast){
|
||||
color = ((color - 0.5) * max(contrast, 0.0)) + 0.5;
|
||||
}
|
||||
|
||||
void ApplyDistortion(inout vec2 Texcoord, vec2 TangentNormals, vec2 depths){
|
||||
void ApplyDistortion(inout vec2 Texcoord, vec2 TangentNormals, vec2 depths, bool isEntity){
|
||||
|
||||
vec2 UnalteredTexcoord = Texcoord;
|
||||
|
||||
float refractionStrength = isEntity ? 0.5 : 1.0;
|
||||
|
||||
Texcoord = abs(Texcoord + (TangentNormals * clamp((ld(depths.x) - ld(depths.y)) * 0.5,0.0,0.15)) * RENDER_SCALE );
|
||||
Texcoord = abs(Texcoord + (TangentNormals * clamp((ld(depths.x) - ld(depths.y)) * 0.5,0.0,0.15)) * RENDER_SCALE * refractionStrength );
|
||||
|
||||
float DistortedAlpha = decodeVec2(texture2D(colortex11,Texcoord).b).g;
|
||||
|
||||
@ -222,7 +223,7 @@ void main() {
|
||||
|
||||
vec4 albedo = vec4(unpack0.ba,unpack1.rg);
|
||||
vec2 tangentNormals = unpack0.xy*2.0-1.0;
|
||||
if(albedo.a <= 0.0) tangentNormals = vec2(0.0);
|
||||
if(albedo.a < 0.01) tangentNormals = vec2(0.0);
|
||||
vec4 TranslucentShader = texture2D(colortex2, texcoord);
|
||||
|
||||
////// --------------- UNPACK MISC --------------- //////
|
||||
@ -230,6 +231,7 @@ void main() {
|
||||
|
||||
////// --------------- MASKS/BOOLEANS --------------- //////
|
||||
bool iswater = trpData > 0.99;
|
||||
bool isTranslucentEntity = abs(trpData-0.1) < 0.01;
|
||||
float translucentAlpha = trpData;
|
||||
|
||||
////// --------------- get volumetrics
|
||||
@ -239,7 +241,7 @@ void main() {
|
||||
////// --------------- distort texcoords as a refraction effect
|
||||
vec2 refractedCoord = texcoord;
|
||||
#ifdef Refraction
|
||||
ApplyDistortion(refractedCoord, tangentNormals, vec2(z2,z));
|
||||
ApplyDistortion(refractedCoord, tangentNormals, vec2(z2,z), isTranslucentEntity);
|
||||
#endif
|
||||
|
||||
////// --------------- MAIN COLOR BUFFER
|
||||
@ -367,4 +369,8 @@ void main() {
|
||||
|
||||
gl_FragData[0].r = vl.a * bloomyFogMult; // pass fog alpha so bloom can do bloomy fog
|
||||
gl_FragData[1].rgb = clamp(color.rgb, 0.0,68000.0);
|
||||
|
||||
// if(isTranslucentEntity) gl_FragData[1].rgb = vec3(255);
|
||||
|
||||
// gl_FragData[1].rgb = clamp(vec3(tangentNormals.xy,0), 0.0,68000.0);
|
||||
}
|
Reference in New Issue
Block a user