Jump to content

Viewport edges cause shadow shafts


photo

Recommended Posts

The edges of the viewport are having shadow shafts applied to them. This is clear when you rotate the camera around or move the lighting source and goes away when you disable shadow shafts altogether.

 

Attached is an example, taken from the animation_00 UnigineScript sample in 2.4.1. The red arrow points to the location of the sun and the green lines refer to the edges of the dark shading on the viewport. This shifts as you look around.

 

The issue also happens when using multiple viewports.

 

post-1943-0-71283000-1490037433_thumb.png

Link to comment

Hi Justin,

 

Post-processing effects will not work correctly with multiple viewports.

 

You can reduce artifacts by configuring ground grid material states (uncheck Sun shafts options). In the newly generated this option is already disabled (but it still can be enabled in samples).

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

This isn't something that's exclusive to multiple viewports.

 

Disabling the sun shafts state on the terrain had no effect.

 

The issue, as best as I can describe it, seems to be treating the rectangular edge of the screen itself as an object in which to apply sun shafts to. I have yet to see a 2.4+ scene where it is not an issue. I haven't checked if this exists in 2.3, but it didn't exist in 2.2.

Link to comment

Lines 47 through 50 in shadow_shafts_sample.frag appear to be partially at fault. Flipping the float4_zero's to float4_one's (or just removing the code altogether) solves the top and left edges, but not the right and bottom edges. It appears there's an additional issue in shadow_shafts.frag causing problems when the uv coordinates exceed 1 on lines 43 and 45. Ending the loop when the uv's exceed 1.0f and carrying a new sample count to divide by in line 51 to replace NUM_SAMPLES seems to solve the issue completely.

Link to comment
×
×
  • Create New...