Better Resolution on Shadows

Is anyone using or know about any other shadow methods other than Depth Map Shadows?

I’m ok with a method that’s a little slower or even not fully real time so long as it can produce a clean shadow free of artifacts.

With depth map method the limitation is that the resolution from the shadow map can create aliased artifacts if the scene size is very large and rendering from the main camera with a wide FOV. This places tiny parts of the scene very large in frame and the shadow map resolution just can’t keep up.

In my particular scene even if I made the shadow maps 30,000 px it’s still not even close to being enough, I have tried to narrow the light FOV so that its only focused on the geometry as full frame as possible, but like I explained above, there are some conditions which make this incredibly difficult, or impossible.

To my knowledge the other way to do shadows would be similar to Vray, Arnold etc… where the eye ray is shot from the camera POV and then bounces off the object normal and traced to the light, if another object occludes the ray, the pixel is in shadow. I’m not sure if this method is an option in Touch or if it can be done in a shader? Or if there are any other clever methods from the brilliant people in this community :wink:

(unfortunately my geometry is also moving so pre-baking the shadows (as you would do in Unreal) is not really an option either, had to make it hard!!!)

This image sort of outlines key points as a high level process I can imagine possibly working?!

Also open to other tips and tricks this is sort of what the shadows are looking like.

Hoping there is a way to solve this.

Here is a crude example showing how the concept may work in theory. This is quite a brute force manual approach that literally creates a camera for every pixel position. Its slow and causes Touch to crash, because well, replicating hundreds, thousands, or millions of literal cameras is not a good idea. What would be best is to do this work entirely at the shader level, so its “virtually” rotating a camera matrix. I hope this demo helps understand the nature of the solution better and how it in theory maybe it could be solved.

To summarize the process…
For each pixel

  1. query the world position
  2. query the light position
  3. Internally in the shader code, rotate the world camera matrix to the new world matrix position and orientation (per pixel)
  4. output the pixel shadow mask - black or white (for each pixel).

I’m not sure maybe its not possible to rotate a camera matrix per pixel in a shader?

here is some research on the subject of raytracing as well:
scratchapixel.com/lessons/3d … nd-shadows

If anyone can provide more guidance would be appreciated. Its an odd problem but I think a fun one for you smart people out there :slight_smile:
raytrace_camera.11.toe (19.1 KB)