Skip to main content
GameDev.net gamedev.net
🔒 Locked

Nocturne

Started by Dark One Dec 3, 2001 at 11:03 AM 6 replies 1.4k views
Original Post
Dark One
Dark One
I was just wondering how were the shadows done in Nocturne. As I''ve understood they were realtime rendered, had soft edges and looked really realistic.
Skulver
Skulver
I am not sure how it was done in nocturne but to do it in OpenGL or DirectX you use a stencil buffer trick to generate soft shadows. There are a lot of great articles on the subject on nvidias site at

http://developer.nvidia.com/view.asp?IO=reflections_shadows_stencil_buffers

Eamonn

Sneftel
Sneftel
I have to assume that they had two versions of the background... one completely in shadow, the other completely out of shadow. Certain shadow-recieving objects were geometrically defined, as well as shadow-casting objects. Then the shadow-casters were simply warped onto the shadow-recievers, the resultant image was quick-blurred (thinking back, I don''t think the shadows were anisotropically blurred) and used as an alpha map for drawing the shadowed background over the unshadowed.
Skulver
Skulver
quote:
Original post by Anonymous Poster
You can''t use the stencil buffer to create soft shadows, only hard shadows.


Yes you can if your stencil buffer has a bit depth of more than 1 bit. Read the articles on nvidias site and it tells you all about it, the article "Improving Shadows and Reflections via the Stencil Buffer" is particularly good and discusses how you achieve this on modern hardware.

Even with a stencil buffer depth of 1 bit it is possible to do proper soft shadows if you make multiple passes, you can make one pass where you use a soft shadow stencil buffer, then clear the stencil buffer and make a hard shadow stencil buffer and re-render the scene again.

Next time someone takes the trouble to provide a link to the current reading matter on the subject it might be an idea if you take the time to read the source material and gain an accurate knowledge yourself before you rush of to contradict.

Eamonn


lunarss
lunarss
The shadows in nocturne were probably pretty easy to do because the point of view of the scene never changes so you can make many assumptions about it. The soft shadows are created with stencil buffer by sampling several points on the light and accumulating the result. This approach is extremely slow and produces poor results unless you have a great deal of samples, read no less than 25. The problem with it is that there is a linear cost per sample, and thats bad if you need more than 25 to have decent results. Have you tried the demo of this? I get 45fps with a Geforce2 and 8 samples. Not so good.
TerranFury
TerranFury
It looked to me like they rendered the shadows to a small texture and then scaled it up using bilinear filtering for the softness.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.