Noselfshadows: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(New page: The best way to explain the noselfshadows keyword is an example: 250px 250px The lion in the screenshots has '''noselfshadow''' def...)
 
No edit summary
 
(3 intermediate revisions by one other user not shown)
Line 5: Line 5:
The lion in the screenshots has '''noselfshadow''' defined in his material. This means, that
The lion in the screenshots has '''noselfshadow''' defined in his material. This means, that
# other surfaces '''without''' noselfshadows can cast shadows on the lion (e.g. the pillar can cast on lion).
# other surfaces '''without''' noselfshadows can cast shadows on the lion (e.g. the pillar can cast on lion).
# the lion cannot cast shadows on other surfaces '''with''' noselfshadows. This trivially includes the lion itself.
# the lion cannot cast shadows on other surfaces '''with''' noselfshadows. This trivially includes the lion itself and the other lion in the right screen.
# the lion can cast shadows on other materials '''without''' noselfshadows (e.g. the pillar in the background).
# the lion can cast shadows on other materials '''without''' noselfshadows (e.g. the pillar in the background).


In other words, noselfshadow inhibits casting shadows if  
In other words, noselfshadow inhibits casting shadows if  
  originMaterial.noSelfShadows == true && targetMaterial.noSelfShadows == true
  originMaterial.noSelfShadows == true && targetMaterial.noSelfShadows == true
From the view of the renderer, the noselfshadow keyword is handled like this (quoted from [http://www.iddevnet.com/doom3/ iddevnet]):
01/06/05 What noSelfShadow does
The way the renderer handles noSelfShadow is it:
1. Renders all selfShadow objects shadows to the stencil buffer
2. Renders all noSelfShadow objects with lighting
3. Renders all noSelfShadow objects shadows to the stencil buffer
4. Renders all selfShadow objects with lighting
So basically what happens is when 'noSelfShadow' objects are rendered, their shadows haven't been rendered to the stencil buffer yet. But by the time  'selfShadow' objects are rendered, all shadows have been rendered (self and otherwise).
This means an object with 'noSelfShadow' will not cast a shadow onto a different object with 'noSelfShadow'
In other news, we're back from the holidays :)


{{shaderkeywords}}
{{shaderkeywords}}
[[Category:Lighting]]

Latest revision as of 21:01, 13 April 2011

The best way to explain the noselfshadows keyword is an example:

Noselfshadow.jpg Noselfshadow2.jpg

The lion in the screenshots has noselfshadow defined in his material. This means, that

  1. other surfaces without noselfshadows can cast shadows on the lion (e.g. the pillar can cast on lion).
  2. the lion cannot cast shadows on other surfaces with noselfshadows. This trivially includes the lion itself and the other lion in the right screen.
  3. the lion can cast shadows on other materials without noselfshadows (e.g. the pillar in the background).

In other words, noselfshadow inhibits casting shadows if

originMaterial.noSelfShadows == true && targetMaterial.noSelfShadows == true

From the view of the renderer, the noselfshadow keyword is handled like this (quoted from iddevnet):

01/06/05 What noSelfShadow does
The way the renderer handles noSelfShadow is it:

1. Renders all selfShadow objects shadows to the stencil buffer
2. Renders all noSelfShadow objects with lighting
3. Renders all noSelfShadow objects shadows to the stencil buffer
4. Renders all selfShadow objects with lighting

So basically what happens is when 'noSelfShadow' objects are rendered, their shadows haven't been rendered to the stencil buffer yet. But by the time  'selfShadow' objects are rendered, all shadows have been rendered (self and otherwise).

This means an object with 'noSelfShadow' will not cast a shadow onto a different object with 'noSelfShadow'

In other news, we're back from the holidays :)