Commit Graph

6 Commits

Author SHA1 Message Date
DeMuenu
65c34d2ddf Refactor light range and angle calculations
Updated how light range and spot angle are calculated and packed for both editor and runtime scripts, distinguishing between sphere and non-sphere lights. Adjusted shader logic to use new packing for spot light contribution, improving consistency between CPU and GPU representations.
2025-10-04 04:10:43 +02:00
DeMuenu
bb31145e4d smooth falloff, but not correct angles
Replaced usage of GetCosHalfAngle() with spotAngleDeg for spot light calculations in both editor and runtime scripts. Updated shader logic to use smoothstep for light contribution falloff, improving spot light edge smoothness.
2025-10-03 23:27:27 +02:00
DeMuenu
8e740bd636 Add shadowcaster blur support to shaders
Introduces a _BlurPixels property and related parameters to BlendinShader and LitParticles shaders, enabling blurred shadowcaster sampling. Updates Shadowcaster.cginc to support blurred texture sampling using tex2Dgrad when blur is enabled. Also adjusts light intensity calculation in LightStrength.hlsl to remove NdotL multiplication for consistency with new shadow handling.
2025-10-01 14:48:44 +02:00
DeMuenu
b94c52da3c Rename shader light variables to Udon-prefixed versions
Updated all relevant shader files and C# script to use Udon-prefixed light and player variables (e.g., _Udon_LightPositions, _Udon_LightColors, _Udon_PlayerCount) for consistency and to avoid naming conflicts. This change affects variable declarations, macro definitions, and all usages in BlendinShader, LitParticles, Water shaders, and included HLSL files.
2025-09-26 23:13:06 +02:00
DeMuenu
07730827f4 Refactor lighting code and add wave support to shaders
Modularized lighting calculations by introducing DefaultSetup.hlsl and Lambert.hlsl includes, and updated BlendinShader, LitParticles, and Water shaders to use these macros. Added new wave-related properties and logic to Water.shader for enhanced wave effects. Improved maintainability and consistency across shaders by centralizing light and Lambertian diffuse calculations.
2025-09-25 02:21:26 +02:00
DeMuenu
b9bfd0b559 Refactor light calculations into LightStrength.hlsl include
Moved light type calculation logic from BlendinShader.shader to a new include file, LightStrength.hlsl, for better modularity and maintainability. Updated the shader to use the new macro for light calculations, improving code clarity and reducing duplication.
2025-09-24 17:51:23 +02:00