Relief maps with self-shadowing



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

Webplayer (1.1 MB):
http://proglet.com/software/Relief_Pro/Relief_Pro_0_0_5.html

Note: You can play with some settings by hitting in the webplayer.

The package is included below.
Edit: ONLY WORKS ON PRO
For Indie users, I previously posted a simpler version without shadows: http://forum.unity3d.com/viewtopic.php?t=10927

To use:

  • 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.

77172–2972–$relief_pro_0_0_5_189.unitypackage (2.72 MB)

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. :wink:

–Eric

77177--2952--$picture_6_178.jpg
77177--2953--$picture_7_109.jpg

I only see a pink background on my Macbook :confused:

Needs more fallback shaders?

MBP - all great.
The floor looks painful to walk on… I kinda cringed as I walked around.

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 :frowning:

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.

Awesome! Works fine on my iMac w/ X1600.

Looking real funky on my mbp running a radeon x1600 and OS X 10.5.2. This is what I see:

http://www.getdropbox.com/gallery/18971/0/?h=61e159

Yup, just tried it here on a MBP running 10.4.11 and get the same result.

No problems here. MBP Peryn Generation, OSX 10.5.2

Looks very nice, thank you for sharing :slight_smile:

This kind of things is what makes me consider Unity Pro even more than I already do … dooohhh :?

Didn’t they ship a new graphics card with that one?

NVIDIA 8600M GT 256MB here

Given you had 256MB before they would be identical.

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.

This is from my console (Intel Core Duo 2 MBP with ATI X1600 graphics):

np_entry: NP_Initialize called
np_entry: NP_GetEntryPoints called
080522 09:30:48 Datafile [url]http://proglet.com/software/Relief_Pro/Relief_Pro.unity3d[/url]
080522 09:30:48 Loading Unity Player
080522 09:30:48 loader: unity function UnityBundleStart load failed
080522 09:30:48 loader: unity function UnityBundleSetupScreen2 load failed
Player: init engine
080522 09:30:51 Loader: Start Success
host: proglet_2ecom Pref folder: /Users/ImAUser/Library/Preferences

… 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.

Just thought I’d chime in and say that this looks quite cool indeed. Nice work!

Doesn’t work here : I tried everything to escape from this welcoming place, but with no success :evil:

Seriously, it works perfectly (iMac alu 24’, Radeon HD2600). Thanks a lot for sharing your amazing work ! :smile: