World Position Offset after Shadow projection and depth check

Have a World Position Offset that changes camera perspective to Fisheye, deforming scene.
Dynamic shadow pass is calculated after World Position Offset resulting errors. Static baked shadows look OK.

Question is, how to change shadow pass order so that dynamic shadows are calculated before WPO?

Or how to set shadow and reflection shader to use WorldPosition (Excluding Material Offsets)?

I’d like to know this too ! since my game uses fisheye as well lol ( point lights don’t seem to work with it also, so I guess how do we update lighting before the WPO?) Perhaps you figured that out already? if so please let me know!

Sorry to jack your thread, but to show people what fisheye looks like.,… and for my issue…
For point lights Here’s the partial solution we came up with in UDK, by moving the lights during gameplay using Fisheye math, it kind of faked what we were going for, there are some issues though, which are not shown here. The issues that it had was when moving inward and outwards in the level. ( the lights would kinda slide around. The other issue was if you had a large light radius than we were back to seeing the light slide around walls which was odd to look at.

Thought Im only one using fisheye vertex shader. Think this shadow pass before WPO is UE4 feature and guess changing it requires some notepad work in BasePassForForwardShadingPixelShader.usf located in Engine\Shaders but that’s hard to figure out when you’re not a programmer.

Tell me more about your game, is that this Sonic? Did you made fisheye shader by your own or got it from youtube/forum?

I been working on this game since 2006 based on the canceled sonic X-treme game from Sega Saturn from 1996. the original game had fisheye and yes it ran on Sega Saturn and windows 95 PC. It took us a few years to figure out how to do fisheye shader the way they did it (this was back in 2008 or so). That was when the game was in Game maker and used Ult 3D plugin, We later moved to UDK, which was a godsend! everything was perfect ad we got most of the gameplay complete, But the only drawback was that we could not rotate the player collision cylinder which caused some gameplay issues because our gameplay worked with rotating worlds. ( we had some work abounds in place, but they were not perfect, Now we are in Unreal 4. It took 1 year to catch up with re-setting up all the assets that we had set up in UDK. We were in UDK from from 2011 - 2015.
Quite a long time for a hobby project ! A lot of the time went into rebuilding as many of the original test levels from the original game. there are over 90 of them! And I plan to do some custom levels as well, because the original beta levels really didn’t play well with their poor level layouts.

and here’s the forum thread,

How about your project ?

I see what you did with that space bending. Made similar shader for curved earth effect where you would input planet radius, and the origin of bending would be at camera location minus planet radius.
That’s a long time indeed for a hobby project.
I was interested into creating fisheye shader to fix linear perspective problems, like movement nausea, deformations on the screen edges. Did you know that in 1420 AD, when linear perspective was introduced, people call it “Italian Stylization” as they did not seen it realistic.
For a personal scientific research, created shader that can render 3D environment in Orthographic or Stereographic perspective, giving more natural motion.

That is a very interesting story! and I wish you the best of luck with your project ! I’ll be keeping my eye on this to see if we get our answers related to doing the shadow pass before the WPO pass because I think its very important!

Idea… It don’t look like we can use world position offset inside a post process effect because the input is greyed out.
However can a Post process contain a world position offset for all mesh on screen some other way maybe?

Maybe it would be possible after editing “PostProcessMaterialShaders.usf” (located in “Epic Games\UE_4.9\Engine\Shaders”). But that’s just guessing. I would likely pay someone for figuring that out.