Yeah see... the PC one is what it's SUPPOSED to look like (the striping is because of how the depth is packed into RGB). The problem is most likely that on the OUYA it's not rendering at all what it's supposed to be rendering. Maybe replacement shaders don't work on Android??
You didn't remember the plot of the Doctor Who movie because there was none; Just a bunch of plot holes strung together.
AHA! I have solved the problem. It's because Shader.Find is returning null in the final build (also in webplayer) The solve is to instead:
Make a public field in ShadowManager.cs (call it RenderDepthShader) Replace the call to Shader.Find( ... ) with that public Shader. In the Editor, drag the RenderDepth shader onto that new slot.
Let me know if that works!
You didn't remember the plot of the Doctor Who movie because there was none; Just a bunch of plot holes strung together.
I actually did a simple test where I made a web player build and was running into the same problems you are reporting - the shadows looked totally wrong. It appears to be that Unity is trying to be smart and determines that the shader shouldn't be included in the final build (after all, no material or object is referencing it). The fix is of course to replace the Find call with an actual, hard reference to the shader so that Unity is forced to include the shader in the build (and indeed that fixed the shadow issues in my test webplayer build)
You didn't remember the plot of the Doctor Who movie because there was none; Just a bunch of plot holes strung together.
There's definitely some difference in shader output Ouya vs. PC. I made Shadow Map Coverage small (8) and the render large so you could see the output of depth shader on each platform.
Here's Ouya:
And here's PC:
In my game the flies around over a simple static terrain that is ~6000x6000 Unity units across. What would be recommended settings for the Shadow Manager parameters for that case? The style of the game is deliberately retro/low resolution (as you can see from the screenshots), so I'm happy if the shadows are obviously pixelated (that's actually preferable).
I suppose the difference could be due to a difference in depth buffer precision (wild guess here) But it appears to work.. so that good.
As for values, I can't really suggest anything. I suppose increase the coverage until it's far enough to look acceptable, and then play around with resolution.
Perhaps 100 meter coverage, 1024 shadowmap size? See if that's fast enough for the OUYA.
You didn't remember the plot of the Doctor Who movie because there was none; Just a bunch of plot holes strung together.
I took a break from this to submit my game (it got accepted, wooo! I'm a Day 1 launch title =])... shadows are disabled in that build. Will tune and include in the next submission.
Editor1 - Default start position on editor. You can just see the shadow on the right edge of the car. Editor2 - I moved to the side and rotated the car a bit to make the shadow more obvious. Editor3 - Rotated some more to basically face the sun... I captured this angle because it's the only one that works on Ouya!
Ouya1 - Default start position on Ouya. Shadow is invisible. Ouya2 - Similar angle to Editor2. Still no shadow! Ouya3 - Similar angle to Editor3. Now we can see the shadow (and it looks perfect!)
Any idea why the shadow would behave so differently on Ouya? I don't need to support a PC version, so I'm happy to break the PC/editor shadows in favor of the Ouya shadows...
Updating this with latest progress. I'm really close to a solution that I haven't yet been able to solve:
So today I'm trying to figure out why the pixels below the "magic line" in the texture don't cast a shadow, as the downstream pipeline (i.e., actually projecting shadows into the world) works great and gives me exactly the kind of low-resolution look I'm hoping for!
This got me a full shadow on the car, regardless of rotation. Unfortunately, it also introduced a new artifact - a large shadow line in the middle distance (marked with yellow arrow):
I was able to reduce this artifact by setting these values:
Shadow Map Coverage: 10
Shadow Map Far: 3500
This is not perfect... that far clip plane feels very large, and I still get artifacts in some situations. I don't this solution will scale to larger levels, for example. But it's progress.
I am 99% sure that the problem lies in encoding/decoding the texture to/from RGBA. And I'm suspecting the decode, because if you look at screenshot number 2 here:
...you can see that the shadow map texture is still stripy, but it's the wrong color.
Comments
Maybe replacement shaders don't work on Android??
I have solved the problem.
It's because Shader.Find is returning null in the final build (also in webplayer)
The solve is to instead:
Make a public field in ShadowManager.cs (call it RenderDepthShader)
Replace the call to Shader.Find( ... ) with that public Shader.
In the Editor, drag the RenderDepth shader onto that new slot.
Let me know if that works!
OUYA Inc | Android Developer
Skype: tgraupmann_prey
http://github.com/ouya/docs
http://github.com/ouya/ouya-sdk-examples
Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]
Use caution when setting [persistent wireless mode].
The fix is of course to replace the Find call with an actual, hard reference to the shader so that Unity is forced to include the shader in the build (and indeed that fixed the shadow issues in my test webplayer build)
OUYA Inc | Android Developer
Skype: tgraupmann_prey
http://github.com/ouya/docs
http://github.com/ouya/ouya-sdk-examples
Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]
Use caution when setting [persistent wireless mode].
But it appears to work.. so that good.
As for values, I can't really suggest anything. I suppose increase the coverage until it's far enough to look acceptable, and then play around with resolution.
Perhaps 100 meter coverage, 1024 shadowmap size? See if that's fast enough for the OUYA.
OUYA Inc | Android Developer
Skype: tgraupmann_prey
http://github.com/ouya/docs
http://github.com/ouya/ouya-sdk-examples
Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]
Use caution when setting [persistent wireless mode].
Editor1 - Default start position on editor. You can just see the shadow on the right edge of the car.
Editor2 - I moved to the side and rotated the car a bit to make the shadow more obvious.
Editor3 - Rotated some more to basically face the sun... I captured this angle because it's the only one that works on Ouya!
Ouya1 - Default start position on Ouya. Shadow is invisible.
Ouya2 - Similar angle to Editor2. Still no shadow!
Ouya3 - Similar angle to Editor3. Now we can see the shadow (and it looks perfect!)
Any idea why the shadow would behave so differently on Ouya? I don't need to support a PC version, so I'm happy to break the PC/editor shadows in favor of the Ouya shadows...
Thx again for all the help,