mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2026-10-10 05:03:04 +08:00
improve handheld light in third person, and on hands in firstperson
This commit is contained in:
@@ -1255,9 +1255,11 @@ void main() {
|
||||
|
||||
#if HANDHELD_LIGHTSOURCE_MODE > 0
|
||||
// float flashlightshadows = SSRT_FlashLight_Shadows(shiftedViewPos, isDHrange, normalize(shiftedPlayerPos), interleaved_gradientNoise_temporal());
|
||||
|
||||
vec3 handheldViewPos = viewPos;
|
||||
if(hand) handheldViewPos.z += 0.7;
|
||||
|
||||
Indirect_lighting += doHandHeldLight(
|
||||
viewPos, slopednormal
|
||||
handheldViewPos, slopednormal
|
||||
#if defined HANDHELD_LIGHTSOURCE_SPECULAR && defined DEFERRED_SPECULAR
|
||||
,mainHandPos, mainHandCol, offHandPos, offHandCol
|
||||
#endif
|
||||
|
||||
@@ -140,6 +140,9 @@ void calculateFinishedPointLight(
|
||||
inout vec3 handPos, inout vec3 lighting
|
||||
){
|
||||
if(lightLevel > 1e-6){
|
||||
|
||||
viewPos.z -= max((mat3(gbufferModelView) * playerLookVector).z,0);
|
||||
|
||||
// offset viewPos to match hand position
|
||||
handPos = mat3(gbufferModelViewInverse) * (viewPos + handOffset) + gbufferModelViewInverse[3].xyz;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user