mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-27 02:32:39 +08:00
initial setup for scene controller (functional concept)
This commit is contained in:
@ -259,6 +259,9 @@ vec4 texture2D_POMSwitch(
|
||||
return texture2DGradARB(sampler, lightmapCoord, dcdxdcdy.xy, dcdxdcdy.zw);
|
||||
}
|
||||
|
||||
float luma(vec3 color) {
|
||||
return dot(color,vec3(0.21, 0.72, 0.07));
|
||||
}
|
||||
uniform vec3 eyePosition;
|
||||
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
@ -410,6 +413,14 @@ void main() {
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
directLightColor = lightCol.rgb/2400.0;
|
||||
AmbientLightColor = averageSkyCol_Clouds / 900.0;
|
||||
|
||||
#ifdef USE_CUSTOM_DIFFUSE_LIGHTING_COLORS
|
||||
directLightColor = luma(directLightColor) * vec3(DIRECTLIGHT_DIFFUSE_R,DIRECTLIGHT_DIFFUSE_G,DIRECTLIGHT_DIFFUSE_B);
|
||||
AmbientLightColor = luma(AmbientLightColor) * vec3(INDIRECTLIGHT_DIFFUSE_R,INDIRECTLIGHT_DIFFUSE_G,INDIRECTLIGHT_DIFFUSE_B);
|
||||
#endif
|
||||
|
||||
|
||||
float Shadows = 1.0;
|
||||
|
||||
vec3 shadowPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz;
|
||||
@ -435,7 +446,6 @@ void main() {
|
||||
// Direct_lighting *= phaseg(clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0), 0.65)*2 + 0.5;
|
||||
// #endif
|
||||
|
||||
AmbientLightColor = averageSkyCol_Clouds / 900.0;
|
||||
|
||||
#ifdef IS_IRIS
|
||||
AmbientLightColor *= 2.5;
|
||||
|
@ -567,7 +567,13 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
vec3 DirectLightColor = lightCol.rgb/2400.0;
|
||||
vec3 AmbientLightColor = averageSkyCol_Clouds/900.0;
|
||||
|
||||
#ifdef USE_CUSTOM_DIFFUSE_LIGHTING_COLORS
|
||||
DirectLightColor = luma(DirectLightColor) * vec3(DIRECTLIGHT_DIFFUSE_R,DIRECTLIGHT_DIFFUSE_G,DIRECTLIGHT_DIFFUSE_B);
|
||||
AmbientLightColor = luma(AmbientLightColor) * vec3(INDIRECTLIGHT_DIFFUSE_R,INDIRECTLIGHT_DIFFUSE_G,INDIRECTLIGHT_DIFFUSE_B);
|
||||
#endif
|
||||
|
||||
if(!isWater && isEyeInWater == 1){
|
||||
float distanceFromWaterSurface = cameraPosition.y - waterEnteredAltitude;
|
||||
float waterdepth = max(-(feetPlayerPos.y + distanceFromWaterSurface),0.0);
|
||||
@ -596,8 +602,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
|
||||
Direct_lighting = DirectLightColor * NdotL * Shadows;
|
||||
|
||||
vec3 AmbientLightColor = averageSkyCol_Clouds/900.0;
|
||||
|
||||
vec3 indirectNormal = worldSpaceNormal / dot(abs(worldSpaceNormal),vec3(1.0));
|
||||
float SkylightDir = clamp(indirectNormal.y*0.7+0.3,0.0,1.0);
|
||||
|
||||
|
@ -898,7 +898,17 @@ void main() {
|
||||
#ifdef OVERWORLD_SHADER
|
||||
DirectLightColor = lightCol.rgb / 2400.0;
|
||||
AmbientLightColor = averageSkyCol_Clouds / 900.0;
|
||||
|
||||
#ifdef USE_CUSTOM_DIFFUSE_LIGHTING_COLORS
|
||||
DirectLightColor.rgb = luma(DirectLightColor.rgb) * vec3(DIRECTLIGHT_DIFFUSE_R,DIRECTLIGHT_DIFFUSE_G,DIRECTLIGHT_DIFFUSE_B);
|
||||
AmbientLightColor = luma(AmbientLightColor) * vec3(INDIRECTLIGHT_DIFFUSE_R,INDIRECTLIGHT_DIFFUSE_G,INDIRECTLIGHT_DIFFUSE_B);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
shadowColor = DirectLightColor;
|
||||
|
||||
|
||||
|
||||
// #ifdef PER_BIOME_ENVIRONMENT
|
||||
// // BiomeSunlightColor(DirectLightColor);
|
||||
|
@ -529,14 +529,11 @@ void main() {
|
||||
vec3 indirectLightColor = averageSkyCol / 1200.0;
|
||||
vec3 indirectLightColor_dynamic = averageSkyCol_Clouds / 1200.0;
|
||||
float cloudPlaneDistance = 0.0;
|
||||
float THINGY = 0;
|
||||
|
||||
#if defined OVERWORLD_SHADER
|
||||
// z0 = texture2D(depthtex0, tc + jitter/VL_RENDER_RESOLUTION).x;
|
||||
// viewPos0 = toScreenSpace_DH(tc/RENDER_SCALE, z0, DH_z0);
|
||||
vec4 VolumetricClouds = GetVolumetricClouds(viewPos0, BN, WsunVec, directLightColor, indirectLightColor, cloudPlaneDistance);
|
||||
THINGY = cloudPlaneDistance-length(playerPos);
|
||||
#ifdef CAVE_FOG
|
||||
|
||||
#ifdef CAVE_FOG
|
||||
float skyhole = pow(clamp(1.0-pow(max(playerPos_normalized.y - 0.6,0.0)*5.0,2.0),0.0,1.0),2)* caveDetection;
|
||||
VolumetricClouds.rgb *= 1.0-skyhole;
|
||||
VolumetricClouds.a = mix(VolumetricClouds.a, 1.0, skyhole);
|
||||
@ -548,7 +545,6 @@ void main() {
|
||||
|
||||
vec3 sceneColor = texelFetch2D(colortex3,ivec2(tc/texelSize),0).rgb * VolumetricClouds.a + VolumetricClouds.rgb;
|
||||
vec4 VolumetricFog = GetVolumetricFog(viewPos0, WsunVec, BN, directLightColor, indirectLightColor, indirectLightColor_dynamic, atmosphereAlpha, VolumetricClouds.rgb, cloudPlaneDistance);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined NETHER_SHADER || defined END_SHADER
|
||||
@ -560,12 +556,8 @@ void main() {
|
||||
#endif
|
||||
|
||||
if (isEyeInWater == 1){
|
||||
// vec3 underWaterFog = waterVolumetrics(vec3(0.0), viewPos0, length(viewPos0), BN, totEpsilon, scatterCoef, indirectLightColor_dynamic, directLightColor , dot(normalize(viewPos0), normalize(sunVec* lightCol.a ) ));
|
||||
// VolumetricFog = vec4(underWaterFog, 1.0);
|
||||
|
||||
vec4 underWaterFog = waterVolumetrics(vec3(0.0), viewPos0_water, length(viewPos0_water), BN, totEpsilon, scatterCoef, indirectLightColor_dynamic, directLightColor , dot(normalize(viewPos0_water), normalize(sunVec* lightCol.a ) ));
|
||||
|
||||
// VolumetricFog.rgb = underWaterFog.rgb;
|
||||
|
||||
VolumetricFog = vec4(underWaterFog.rgb, 1.0);
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,10 @@ void main() {
|
||||
vec3 minimumlight = vec3(1.0) * 0.01 * MIN_LIGHT_AMOUNT + nightVision * 0.05;
|
||||
averageSkyCol_Clouds = max(normalize(averageSkyCol_Clouds + 1e-6) * min(luma(averageSkyCol_Clouds) * 3.0,2.5),0.0);
|
||||
averageSkyCol = max(averageSkyCol * PLANET_GROUND_BRIGHTNESS,0.0) + minimumlight;
|
||||
|
||||
|
||||
#ifdef USE_CUSTOM_SKY_GROUND_LIGHTING_COLORS
|
||||
averageSkyCol = luma(averageSkyCol) * vec3(SKY_GROUND_R,SKY_GROUND_G,SKY_GROUND_B);
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user