mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2024-12-22 17:47:34 +08:00
center handheld light to eyePosition when using iris. make lightmap handheld lights not function when floodfill is enabled
This commit is contained in:
parent
cdd12d441e
commit
c169916c40
@ -254,6 +254,8 @@ vec4 texture2D_POMSwitch(
|
|||||||
return texture2DGradARB(sampler, lightmapCoord, dcdxdcdy.xy, dcdxdcdy.zw);
|
return texture2DGradARB(sampler, lightmapCoord, dcdxdcdy.xy, dcdxdcdy.zw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uniform vec3 eyePosition;
|
||||||
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
@ -365,8 +367,13 @@ void main() {
|
|||||||
lightmap.y = 1.0;
|
lightmap.y = 1.0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Hand_Held_lights
|
#if defined Hand_Held_lights && !defined LPV_ENABLED
|
||||||
lightmap.x = max(lightmap.x, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(feetPlayerPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
|
#ifdef IS_IRIS
|
||||||
|
vec3 playerCamPos = eyePosition;
|
||||||
|
#else
|
||||||
|
vec3 playerCamPos = cameraPosition;
|
||||||
|
#endif
|
||||||
|
lightmap.x = max(lightmap.x, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length((feetPlayerPos+cameraPosition) - playerCamPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WEATHER
|
#ifdef WEATHER
|
||||||
|
@ -275,7 +275,7 @@ vec4 texture2D_POMSwitch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uniform vec3 eyePosition;
|
||||||
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
@ -315,8 +315,14 @@ void main() {
|
|||||||
|
|
||||||
float torchlightmap = lmtexcoord.z;
|
float torchlightmap = lmtexcoord.z;
|
||||||
|
|
||||||
#ifdef Hand_Held_lights
|
#if defined Hand_Held_lights && !defined LPV_ENABLED
|
||||||
if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(worldpos-cameraPosition)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
|
#ifdef IS_IRIS
|
||||||
|
vec3 playerCamPos = eyePosition;
|
||||||
|
#else
|
||||||
|
vec3 playerCamPos = cameraPosition;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(worldpos-playerCamPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
|
||||||
|
|
||||||
#ifdef HAND
|
#ifdef HAND
|
||||||
torchlightmap *= 0.9;
|
torchlightmap *= 0.9;
|
||||||
@ -351,8 +357,6 @@ void main() {
|
|||||||
if(!ifPOM) maxdist = 0.0;
|
if(!ifPOM) maxdist = 0.0;
|
||||||
|
|
||||||
gl_FragDepth = gl_FragCoord.z;
|
gl_FragDepth = gl_FragCoord.z;
|
||||||
// coord += noise*interval;
|
|
||||||
// float sumVec = noise;
|
|
||||||
if (dist < maxdist) {
|
if (dist < maxdist) {
|
||||||
|
|
||||||
float depthmap = readNormal(vtexcoord.st).a;
|
float depthmap = readNormal(vtexcoord.st).a;
|
||||||
|
@ -430,6 +430,8 @@ void Emission(
|
|||||||
if( Emission < 254.5/255.0) Lighting = mix(Lighting, Albedo * Emissive_Brightness * autoBrightnessAdjust * 0.1, pow(Emission, Emissive_Curve)); // old method.... idk why
|
if( Emission < 254.5/255.0) Lighting = mix(Lighting, Albedo * Emissive_Brightness * autoBrightnessAdjust * 0.1, pow(Emission, Emissive_Curve)); // old method.... idk why
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uniform vec3 eyePosition;
|
||||||
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
@ -586,8 +588,13 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
|||||||
lightmap.y = 1.0;
|
lightmap.y = 1.0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Hand_Held_lights
|
#if defined Hand_Held_lights && !defined LPV_ENABLED
|
||||||
lightmap.x = max(lightmap.x, HELD_ITEM_BRIGHTNESS*clamp( pow(max(1.0-length(feetPlayerPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
|
#ifdef IS_IRIS
|
||||||
|
vec3 playerCamPos = eyePosition;
|
||||||
|
#else
|
||||||
|
vec3 playerCamPos = cameraPosition;
|
||||||
|
#endif
|
||||||
|
lightmap.x = max(lightmap.x, HELD_ITEM_BRIGHTNESS*clamp( pow(max(1.0-length((feetPlayerPos+cameraPosition) - playerCamPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vec3 Indirect_lighting = vec3(0.0);
|
vec3 Indirect_lighting = vec3(0.0);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#define SHADER_VERSION_LABEL 479 // [479]
|
#define SHADER_VERSION_LABEL 480 // [480]
|
||||||
|
|
||||||
#define saturate(x) clamp(x,0.0,1.0)
|
#define saturate(x) clamp(x,0.0,1.0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user