mirror of
https://github.com/DeMuenu/MoonlightVRC.git
synced 2025-12-12 19:13:56 +00:00
Update README.md
This commit is contained in:
12
README.md
12
README.md
@@ -22,28 +22,29 @@ Planned:
|
||||
|
||||
## Performance
|
||||
|
||||
Early testing showed the Quest 3 dropping to around 30 FPS when having 100 spotlights active in a scene at once. This test was conducted with 5 material targets. Since then the shader has grown in size significantly and I have also included some optimizations in the code transferring light data to the objects. Reading the light data and transferring it to the shader seems to be a major bottleneck at the moment but there is room for improvements.
|
||||
Early testing showed the Quest 3 dropping to around 30 FPS when having 100 spotlights active in a scene at once. This test was conducted with 5 material targets. Since then the shader has grown in size significantly there has been optimisa
|
||||
|
||||
On PC, I haven't encountered any frame drops in the editor at all, even with 400 concurrent lights.
|
||||
On PC, I haven't encountered any frame drops in the ediotherLightSources'tor at all, even with 400 concurrent lights.
|
||||
|
||||
## Quick start
|
||||
|
||||
1. Clone the code into your project.
|
||||
|
||||
2. Add the `PlayerPositionsToShader` component to a GameObject in your scene:
|
||||
- Inspect the script in the inspector and assign `targets` (Objects that use a compatible shader) and optional `otherLightSources` (Transforms as described in step 3).
|
||||
- Tweak strength/intensity of the local and remote player if you want them to have an attached light.
|
||||
|
||||
3. For lights, attach `LightdataStorage` to a Transform and configure:
|
||||
- `range`, `type`, `color`, `intensity`, and `spotAngleDeg`.
|
||||
|
||||
4. Add the light transform to your `PlayerPositionsToShader` component's `otherLightSources` array.
|
||||
|
||||
4. Use one of the premade shaders on your objects. Or if you feel like it, use the provided .hlsl in your own shader. You just need to copy everything surrounded by Moonlight comments, and applying it at the end of your shader.
|
||||
5. Use one of the premade shaders on your material. Or if you feel like it, use the provided .hlsl/.cginc in your own shader. You just need to copy everything surrounded by Moonlight comments, and apply it at the end of your shader.
|
||||
|
||||
---
|
||||
|
||||
## Editor preview
|
||||
|
||||
- While not in Play mode, the editor helper `PlayerPositionsToShaderPreview` (EditorPreview/Editor/PlayerPositionsToShaderPreview.cs) writes the same property blocks to assigned Renderers so you can preview emissive/lighting effects in the Scene view. Those update 10 times a second.
|
||||
- While not in Play mode, the editor helper `PlayerPositionsToShaderPreview` (EditorPreview/Editor/PlayerPositionsToShaderPreview.cs) and `ShadowcasterUpdaterPreview` (EditorPreview/Editor/ShadowcasterUpdaterPreview.cs) write the same property blocks to assigned Renderers so you can preview lighting effects in the Scene view. Those update 10 times a second.
|
||||
- The editor partial helper for building preview arrays is in `EditorPreview/PlayerPositionsToShader.Editor.cs`.
|
||||
|
||||
---
|
||||
@@ -57,3 +58,4 @@ On PC, I haven't encountered any frame drops in the editor at all, even with 400
|
||||
## Contributing
|
||||
|
||||
If you want to help with development, please contact me on Discord (@demuenu) so we can coordinate our efforts.
|
||||
If your somebody with a education in Computer graphics, I would be even more thankfull for your help. As right now, it's just me with ~1.5 years of messing around in Shaderlab and ChatGPT as my advisor. So I'm sure that there are serious flaws in the codebase :-)
|
||||
Reference in New Issue
Block a user