Commit Graph

28 Commits

Author SHA1 Message Date
DeMuenu
6981c39859 Add shadow casting toggle to shaders
Introduced an _EnableShadowCasting property to BlendinShader, LitParticles, and Water shaders, allowing shadow casting to be enabled or disabled via a material parameter. Updated shadow sampling logic to respect this toggle, and added related parameters and includes where necessary. Also added a Cull Mode property to BlendinShader for improved rendering control.
2025-10-02 16:03:25 +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
0e633983cf Refactor shadowcaster to use explicit plane basis
Replaces the use of world-to-local matrices for shadowcaster planes with explicit plane origin, basis, and normal vectors in both C# and shader code. Updates property setting in ShadowcasterUpdater and its editor preview, and rewrites the shadow sampling function in the shader include to use the new basis. Adjusts all affected shaders to use the new properties and sampling function for improved clarity and flexibility.
2025-10-01 13:26:33 +02:00
DeMuenu
841d99ad0e Merge branch 'main' into shadow-plane 2025-10-01 02:16:22 +02:00
DeMuenu
a4b70d0dee Merge pull request #4 from DeMuenu/normal-maps-main-shader
Fixed false Normal logic for water shader
2025-10-01 02:15:42 +02:00
DeMuenu
a5a4b16527 Update README.md
spelling
2025-09-30 16:43:33 +02:00
DeMuenu
75aa74fcf2 Update README.md 2025-09-30 15:42:30 +02:00
DeMuenu
061ac7fdc6 Remove unused shadow properties from shaders
Deleted shadow-related properties from BlendinShader.shader and LitParticles.shader to clean up unused parameters and simplify shader property blocks.
2025-09-30 13:02:05 +02:00
DeMuenu
fd5eb748e2 Add support for multiple shadowcaster planes
Extended ShadowcasterUpdater and shaders to handle multiple shadowcaster planes by introducing indexed properties and logic for two shadowcaster sets. Updated property names and shader logic to support per-index shadowcaster textures, colors, and brightness, enabling more flexible shadow casting in scenes.
2025-09-30 12:59:56 +02:00
DeMuenu
b714c7c33a Update README.md 2025-09-30 10:38:17 +02:00
DeMuenu
ca28f1078b Fixed false Normal logic
Added tangent and bitangent calculations to the vertex shader and used a TBN (tangent, bitangent, normal) basis to properly combine and transform normal maps in the fragment shader. This enhances the realism of water surface lighting by accurately handling multiple normal maps.
2025-09-30 10:23:13 +02:00
DeMuenu
7a3065211e Add shadow caster support to LitParticles shader
Introduced shadow caster texture, color, outside color, and minimum brightness parameters to the LitParticles shader. Moved related variable declarations to Variables.hlsl for reuse and removed redundant declarations from BlendinShader.shader. Updated LitParticles lighting calculation to apply shadow caster effects when appropriate.
2025-09-30 01:20:22 +02:00
DeMuenu
868e713336 Add shadowcaster support to lighting and shaders
Introduces shadowcaster support by adding shadow map index fields to light data, updating PlayerPositionsToShader and LightdataStorage to handle shadow map indices, and extending the shader and its includes to sample shadowcaster planes. Adds ShadowcasterUpdater script and editor preview for updating world-to-local matrices, and updates relevant arrays and property handling throughout the codebase. Also adds a sample plane mesh for shadowcasting.
2025-09-29 23:14:38 +02:00
DeMuenu
bce6fbdc3d Merge pull request #3 from DeMuenu/normal-maps-main-shader
Replace multiply texture with normal map support
2025-09-29 18:49:50 +02:00
DeMuenu
1f1f6f795d Replace multiply texture with normal map support
Removed the multiply texture and its strength property, and added support for a normal map with adjustable strength. Updated vertex and fragment shaders to handle tangent space and normal mapping, improving surface detail rendering.
2025-09-29 01:11:47 +02:00
DeMuenu
8780f50ebc Fixed stuff I broke by merging :-P
also twerked the waves a bit
2025-09-27 01:04:28 +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
7189afee7b Merge pull request #2 from DeMuenu/optimise
Optimise stuff
2025-09-26 20:32:46 +02:00
DeMuenu
2c4a0e73b1 Merge pull request #1 from DeMuenu/MakeModular
Make modular
2025-09-26 20:17:34 +02:00
DeMuenu
dc939d0ef6 Add WaterParticle shader and minor water shader tweaks
Introduced a new WaterParticle shader for rendering water particles with alpha blending. Made minor formatting and calculation adjustments in Water.shader and DefaultSetup.hlsl, and updated Variables.hlsl. Added corresponding .meta files for new shader assets.
2025-09-26 20:11:49 +02:00
DeMuenu
e5f18d7464 Update README.md 2025-09-26 17:56:36 +02:00
DeMuenu
c7e2397d81 Update shader property handling for VRCShader API
Changed shader property names to use '_Udon_' prefix and switched to using VRCShader.PropertyToID and VRCShader.SetGlobal* methods for setting shader properties. Added update throttling in LateUpdate for performance. These changes improve compatibility and efficiency with the VRC SDK3 Rendering API.
2025-09-26 17:31:00 +02:00
DeMuenu
0f049de062 Refactor Moonlight lighting system in shaders
Replaces direct variable declarations and code blocks related to 'MoonsLight' with a new 'MoonlightGlobalVariables' macro included from Variables.hlsl. Adds OutLoopSetup macro for loop setup, updates all relevant shaders to use the new macros, and renames comments and identifiers from 'MoonsLight' to 'Moonlight' for consistency. Removes the obsolete MoonsLight.cingc include and its meta file.
2025-09-25 16:09:24 +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
DeMuenu
8f0fb9ab7c Update README.md
Fixed typo, and added light maps as a goal
2025-09-24 16:45:41 +02:00
DeMuenu
25aa259a38 Add initial README with project overview
Introduces a README file describing the MoonlightVRC project, its features, performance notes, quick start instructions, editor preview details, tips, and contribution guidelines.
2025-09-24 16:20:42 +02:00
DeMuenu
c5adc24bb0 Initial commit 2025-09-24 09:41:56 +02:00