Edit Nay 25: Should now work on more cards, particularly X800 Package also included again. Please let me know, if it doesn’t run on your Shader Model 2 compatible graphics card
Create a userdefined layer (I have used layer 8 and called it ReliefObjects)
Create an object with a renderer attached
Put the object on the ReliefObjects layer
set the material to use the Relief/Pro/Spec shader
Attach the “Relief” script to the object
Set the “Shadow light” variable to point to an object. The nearest light would be a good one.
The shader will look weird in the editor view or the game view, if they are both open, and you may have to maximize the game view (to hide the editor view) for the effect to work properly.
The self-shadowing only works with one light. The calculated shadow is applied to all pixel lighting.
That looks really amazing. Alas, the webplayer doesn’t work on my X800. Instead, I get black lines and noise artifacts, and flickering rectangles. None of the controls seem to have any effect. The indie version worked without issues, and while it’s still amazing, it’s not quite as amazing as this version looks.
Damn. I had similar problems earlier on myself because of a race condition. Trouble is, if the GPU is deeply pipelined, the result of the first trace passes are not written to texture memory before the next pass tries to read the intermediate results. I solved it on my machine by actually having separate camera render calls for each phase.
Or it might just be an X800 bug
Have you tried switching all options off, so you just have the most simple trace?
Actually it should fallback to bumped specular. That works fine under emulation.
I should probably do some more explicit checking of the intermediate shaders and switch the main shader, if one of them fails.
For those who had problems running this demo, please try again. I probably over-optimized a bit too much the first time around.
A number of fallback shaders more in the style of the indie version are now included.
If the demo doesn’t run on your machine, please try checking the console log, and see if it says anything.
Note that fragment shaders are necessary for the effect to work, but it should at least fallback nicely.
Hmm. On paper, your card should be capable.
I can’ teally figure out version numbers on graphics cards, but I believe that x1600 is newer than R9000, which works under emulation.
Do you see any error messages in the log?
I think this type of problem might have to do with timing, pipelining and stuff like that. I am going to start a thread in ShaderLab about it.
That is just plain cool. Nice work. My crappy work computer has an ancient vid card with 64 MB of VRAM but it can still run this at the “fast” setting. And it looks great! (Sure I’m only pulling 3 fps, but at least it runs!)
Please keep working on this idea. This is major. Thanks for sharing.
… and I’ll add that I don’t have this problem with my 17" iMac that uses the same graphics chip. I’ve posted a bug report on the off chance that it might be a Unity issue rather than an Apple drivers issue.
You should never run into such race conditions (assuming proper drivers). Basically, whenever driver sees that some operation will need result of something that is “still being rendered”, it stalls until it gets the result.
However, if you’re doing something that is undefined by it’s nature, for example rendering into a texture while reading from the same texture, then all bets are off. That particular case would depend on GPU speed, rasterization pattern, moon phase and whatnot.
Ok. I thought I might get away with it, if I never looked at neighbouring pixels. (Yeah the depth-blur shader does do that after all).
To anybody else listening: I am going to try a ping-pong technique with two rendertextures that Aras suggested in ShaderLab. I’ll probably get the time for it within a day or two.