Thursday, April 26, 2007

One Light with multi-shadow

shadow camera必須要將這些物體都涵蓋進去,
儘管已經調了angle of view物體在shadow map佔的大小還是很小,
這時候就可以讓各個局部的物體使是個別的shadow camera。
In some case, we want to light spacious scene.
Objects which create shadow is far far away.
Shadow camera must contain all these objects.
Therefor, object will be very tiny in shadow map.
Even we adjust angle of view...
We will want each grouped objects use there own shadow camera.

這樣就會產生shadow map了,
First, we create several camera.
Each camera contain different objects.
Then attach a MapGen->Shadow on these camera.
After these step, these camera will create shadow map.

然後在燈光的shadow部份連上一個Combine Color List,
然後每一個Element就是一個Shadow Map,
File由[shdmap $OBJNAME] 變更為 [shdmap cameraShape] (cameraShape為需要產生影子的camera shape名稱)
最後降這些shadow map累加起來就可以了。
Second, our job is to reference these shadow map.
We connect light shader shadow parameter a "Combine color list".
We add element for each shadow camera.
Each element connect a "Shadow map".
Then, set shadow map frequence as "Never".
File value change from [shdmap $OBJNAME] to [shdmap cameraShape].
(cameraShape substitute the cameara shape name )
Finally, sum all the element.

I still do a test for multiple shadow when very strong light.
The result as follows.


renderman render

No comments: