Unity Community |

....any news on this ?
thxxxx
would love to use Dof on Mobile....
Life's What You Make It - don't forget it's YOU
Yea i truely would love to utilize the light shafts and depth of field on mobile.
Drawing your own depth texture when the camera provides it seems like stupidity to me though.
About Simian Squared Recent The Other Brothers Physynth Recommended Shaders+Framework
Just to add to what's already been said, crippling CheckSupport in PostEffectsBase.js does make DoF work on iPad2, although I also had to comment out the lines where the component was disabled (search for "enabled = false" in the same file). Otherwise even though the iPad could do it, the Mac I was building from couldn't, and disabled the component when it opened the scene.
Oh, and it (fairly predictable) destroys the framerate on iPad 2...
Looks very pretty though![]()
Got to be a fast approximation though. Windwaker on gamecube (hardware that isn't as good as ipad2) - does it very quickly. But it is strangely limited. I think probably, camera slicing or something.
Any tips on how this could be done on mobile in a very quick way? I think many of us would love to try it out.
About Simian Squared Recent The Other Brothers Physynth Recommended Shaders+Framework
You don't even have to write you own shader but you can just use the built-in one. If you attach this script to your camera you can make any post process effect work that uses the depth/normal texture:
Code:
using UnityEngine; using System.Collections; { RenderTexture depthNormalTexture; Camera theCam; GameObject shaderCamera; { if(shaderCamera != null) if (depthNormalTexture != null) { depthNormalTexture = null; } } { return; if(theCam == null) theCam = this.GetComponent<Camera>(); if(depthNormalTexture == null) depthNormalTexture = RenderTexture.GetTemporary((int)theCam.pixelWidth, (int)theCam.pixelHeight, 16); if (!shaderCamera) { shaderCamera.hideFlags = HideFlags.HideAndDontSave; } Camera cam = shaderCamera.camera; cam.clearFlags = CameraClearFlags.SolidColor; cam.targetTexture = depthNormalTexture; cam.depth = -2; } // Update is called once per frame } }
arg unity Fix this allready will you!!!!
Even games from 1988 had shadows ! why is Unity taking so long for to support this in iOS?
http://www.youtube.com/watch?v=ALfnZ...eature=related
0. That game didn't have shadows as it did not even have 3D. Thats pure cpu rendering
Also casting shadows from this kind of objects is a thing you can easily do even with unity as projectors work fine here
1. Older games and the first to have it on mobile relied on Stencil Buffer shadows. Stencils are a technology unity does not support in any form nor use to my knowledge and thats not gonna change as Stencils are a thing of the past and have been for a while. In addition they couldn't be exposed to shaderlab as you need low level access to use them, another reason why UT likely never approached it
2. I would assume that Unity 4 will support them. ipad2+ , iphone 4S+ and the current generation of android high ends finally can make use of shadows.
As for depth textures: There is a rumor (didn't verify it yet) that they actually work with unity on iOS at least yet that Unitys editor 'fake opengl es' renderer pretends that it isn't possible or more correctly: fails to return true on the 'is supported' function while it works otherwise.
Last edited by Dreamora; 04-29-2012 at 02:03 PM.
Does anyone have any more information on this? Are shaders that require depth information (i.e. sun shafts) actually supported, but this check just returns false regardless?As for depth textures: There is a rumor (didn't verify it yet) that they actually work with unity on iOS at least yet that Unitys editor 'fake opengl es' renderer pretends that it isn't possible or more correctly: fails to return true on the 'is supported' function while it works otherwise.
When I commented out the check, the shader did work within the editor, but was flickering, weird. Anybody any information, if these shaders are now supported on devices 4S and above?
Unity support rendertextures since v3.0. Prior to v4.0 (which is the official version that support automatic depth textures generation for mobile) you had to construct your own depth buffer to generate depth textures (which was quite easy btw). The big problem is making something like this runs on today's mobile hardware. I still believe current mobile hardware isn't ready for heavy post process. You have to be very careful and approximate your desired effect at the cost of being sometimes weird or unnatural.
Shadows are hugely needed yes but they are also hugely slow on mobile hardware. Your scene have to be drawn multiple times, there's a lot of heavy operations on pixels that must be done, your drawcall will double for each light casting shadows. If shadowgun had shadows with their current scenes setup the requirement to play such a game will be iPad3 and iPhone5 (and they will still look blocky cause even such devices can't afford high res shadowmaps). There's no magic trick here, shadows are heavy as simple as that.
The fastest shadows technique that you can implement in your game is simply "no shadows at all".![]()
Last edited by tatoforever; 12-30-2012 at 01:23 PM.
Forgotten Memories Eden Teaser
Forgotten Memories (Mobile survival horror) Sixth Sense WIP5
I write any shader freely for the community!
Dead Strike iOS (Top iOS game made with Unity).
Nintendo Wii U and Sony PS3/Vita Licensed Developer.
__________________________________________________
Georges Paz
http://www.forgottenmemoriesthegame.com