therealmjp / shadows Goto Github PK
View Code? Open in Web Editor NEWA sample app that demonstrates several techniques for rendering real-time shadow maps
License: MIT License
A sample app that demonstrates several techniques for rendering real-time shadow maps
License: MIT License
In SampleShadowCascade in Mesh.hlsl, when computing the shadow position of the receiving pixel, I believe you should be applying the cascade scale first, then adding the offset.
shadowPosition += CascadeOffsets[cascadeIdx].xyz;
shadowPosition *= CascadeScales[cascadeIdx].xyz;
should be
shadowPosition *= CascadeScales[cascadeIdx].xyz;
shadowPosition += CascadeOffsets[cascadeIdx].xyz;
Purely mathematically speaking, if we think of applying this as a matrix, the latter is the proper order. Of course, depending on the values, these can produce drastically different results. But perhaps in this particular sample's use-case, the difference is not noticeable. Most other samples (like the DX SDK CascadedShadowMap sample) apply these in scale then offset order.
Hi,
I recently worked on 'stable csm' , and then found this repo. Really thanks for your work!
Everything works well when using default config(with nearclip 0.25 and farclip 250), with checking 'Stabilize Cascades'.
But when changing farclip to 1000, some shimmering appear like below:
Is this caused by precision problem or something else? I also tested in Unreal Engine 4.27 with a distance of 50km and 5 cascades, it seems still stable. I do not know what is the key tech. Since our render scene is an outdoor scenario, I wish my shadow can cover 10km or more distance.
Looking forward to your reply!
Hello!
This might be a dumb question but i cannot figure out how to get this to run outside of VS. When i run Shadows.exe i get this error.
It runs fine when debugging inside visual studio. I also tried putting the AntWeakBar64.dll in the same folder as the exe. I gets past that error but just crashes.
Any help is appreciated, and thanks!
This is more of a question than an issue. I noticed in the columns test scene that if the camera and light directions are at a sufficient enough angle, the shadows of columns at the far end of the scene take on the shape of concentric rings (see image below).
I'm guessing this is due to ambiguity between sample positions on the cascade shadow map from the camera's current perspective, but I was curious if you've seen this before and if there is a reason behind the concentric rings shape.
Remaining app settings:
View from above:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.