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.


這樣做必須在燈光下面產生若干個camera,
每個camera負責不同的部份,
然後都為她們貼上shadow(MapGen->Shadow),
這樣就會產生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,
將Frequence設為never,
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.

maya

renderman render

No comments: