Hi,
is there a way to get shadows with PointLight or is it only possible with DirectionalLight?
Shadows with Point Light?Software: Away3D 4.x |
||
Guido, Member
Posted: 06 November 2013 03:50 PM Total Posts: 70 Hi, is there a way to get shadows with PointLight or is it only possible with DirectionalLight? |
||
GoroMatsumoto, Sr. Member
Posted: 06 November 2013 05:41 PM Total Posts: 166 [ # 1 ] PointLight can have only HardShadowMapMethod. Anyway, try the combo. Good luck.
|
||
Guido, Member
Posted: 07 November 2013 08:47 AM Total Posts: 70 [ # 2 ] If I user HardShadowMapMethod I only get a spot like in TV. But what I want is a shadow, which is the result from a object that is between a ligth source and a plane, i think its called shadowcasting. Is this possible with PointLight and HardShadowMapMethod?
|
||
GoroMatsumoto, Sr. Member
Posted: 07 November 2013 10:52 AM Total Posts: 166 [ # 3 ] I will test the combination later.
|
||
|
||
GoroMatsumoto, Sr. Member
Posted: 07 November 2013 12:43 PM Total Posts: 166 [ # 5 ] Here is a demo for PointLight shadow.
lightPicker = new StaticLightPicker([pt]); But the shadow map’s resolution is bad. For DirectionalLight, see examples of Away3D. Good luck. File Attachments SimpleAwayTest.swf (File Size: 131KB - Downloads: 271) |
||
|
||
GoroMatsumoto, Sr. Member
Posted: 07 November 2013 03:08 PM Total Posts: 166 [ # 7 ] What is your goal?
|
||
|
||
GoroMatsumoto, Sr. Member
Posted: 07 November 2013 04:23 PM Total Posts: 166 [ # 9 ] On GPU, you should reduce num of materials I think that kind of containers is not affect for performance. You should marge your materials in one material. And try to use Point/Directional lights in ordinary way. Good luck.
|
||
|
||
GoroMatsumoto, Sr. Member
Posted: 08 November 2013 10:55 AM Total Posts: 166 [ # 11 ] Maybe you should learn about importing a model to Away3d. If you change URLs of model and texture, lines:70-76:
//solider ant texture Be aware of scale of your model.
|
||
Guido, Member
Posted: 08 November 2013 12:11 PM Total Posts: 70 [ # 12 ] I solved the problem. I had not added the light to the scene. If using lightpicker it was no problem before, but shadowing does only work, if the light is added to the scene. But there are still two problems: 1) If I move the light, my shadow does not move (see attachment). The light in the attachment comes from the viewer. 2) I have a kind of spotlight that you can see in the 2nd attachment, althought my radius is very big. These problem i had not without using shadowmethod.
|
||
GoroMatsumoto, Sr. Member
Posted: 08 November 2013 12:52 PM Total Posts: 166 [ # 13 ] At first, confirm a source light of your shadow.
new YourShadowMapMethod(sourceLight); //here
If you use DirectionalLight for the source of shadow,
var dLight:DirectionalLight = new DirectionalLight(0,-1,-1); And maybe you do not set your PointLight as the source.
new HardShadowMapMethod(yourPointLight); //here
And move your PointLight’s “position”.
|
||
Guido, Member
Posted: 08 November 2013 01:48 PM Total Posts: 70 [ # 14 ] Ok, i had 2 instances of pointlight and that’s why the pointlight was not the source. Now the shadow moves with the lightposition. Thank you. Now my only problem is this kind of spotlight, that i see now in my shadow too. If i would give my image a shadowMethod, the spot would appear in the image too (see 2nd Attachment in a further post). My radius is very high, so why do i see spotlight, which i don’t see if i not use shadowcasting? (I work with PointLight and HardShadowMapMethod)
|
||
|