![]() |
|
|
|
#1
|
|||
|
|||
|
When you used the shadow module were all your avatars contained within the area defined by your SHADOW_AREA value. You can increase that value but then the resolution of the shadows will not be as sharp. You can then also increase the resolution of the shadows but that will use up more texture memory.
|
|
#2
|
|||
|
|||
|
But one should make a seperate Shadow.ShadowProjector objects for each avatar. Hence, as I get, SHADOW_AREA is not the area that all the shadows should be contained in, rather it represents a box that each shadow should fit in. Please correct me if I'm wrong.
I suspect that because ShadowProjector is using the projector module in wizard and the projector module is limited by OpenGL's limit of 4 textures on a surface, only 3 avatar shadow textures + the surface's own texture is being applied. Do you know of any alternatives? Best, Omid |
|
#3
|
|||
|
|||
|
Here's a few more avatars added to the shadow example. SHADOW_AREA is set to 10,10 and SHADOW_RES is set to 512 to maintain sharp shadows. Are you able to get 5 shadows here?
Code:
import viz
viz.go()
#Add ground model
ground = viz.add('tut_ground.wrl')
#Add avatars
avatar = viz.add('vcc_female.cfg',pos=(-4,0,12),euler=(180,0,0))
avatar2 = viz.add('duck.cfg',pos=(-2,0,12),euler=(180,0,0))
avatar3 = viz.add('vcc_male.cfg',pos=(0,0,12),euler=(180,0,0))
avatar4 = viz.add('male.cfg',pos=(2,0,12),euler=(180,0,0))
avatar5 = viz.add('female.cfg',pos=(4,0,12),euler=(180,0,0))
avatar.state(5)
avatar2.state(1)
avatar3.state(7)
avatar4.state(9)
avatar5.state(5)
#Shadow resolution (power of two)
#Higher values mean sharper shadows, but take more texture memory
SHADOW_RES = 512
#Postion of shadow projector
SHADOW_POS = [0,10,12]
#Controls size of orthographic shadow projector
#Large values mean larger area is covered, but resolution will be diluted
SHADOW_AREA = [10,10]
#Create shadow projector
import Shadow
shadow = Shadow.ShadowProjector(size=SHADOW_RES,pos=SHADOW_POS,area=SHADOW_AREA)
#Add avatar as a shadow caster
shadow.addCaster(avatar)
shadow.addCaster(avatar2)
shadow.addCaster(avatar3)
shadow.addCaster(avatar4)
shadow.addCaster(avatar5)
#Add ground as shadow receiver
shadow.addReceiver(ground)
|
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shadows in Vizard | Vinicius Lima | Vizard | 4 | 07-26-2010 06:56 PM |
| 3d projector | Vinicius Lima | Vizard | 21 | 03-05-2008 04:51 PM |
| Multiple labs | Plymouth | Vizard | 1 | 03-05-2007 10:43 AM |
| Multiple Stages in one Program | Amit | Vizard | 7 | 11-11-2005 11:20 AM |
| multiple timer trouble | exhale | Vizard | 2 | 04-26-2005 01:21 AM |