How can I enable shadow effect on *.pod object? I set up camera and light but my object didn't have shadow. Can somebody explain how to resolve this?
Asked
Active
Viewed 256 times
1 Answers
1
In order to enable shadows in cocos3d, you must first set
_viewController.viewShouldUseStencilBuffer = NO;
to
_viewController.viewShouldUseStencilBuffer = YES;
in the application delegate.
Next, you must add shadow volumes to the objects of a scene manually.
You can do this by adding this method call to the initialization method of your cc3scene subclass:
[self addShadowVolumesForLight:yourLight];
in order to add shadow volumes to every object in the scene for a specific light, or:
[self addShadowVolumes];
to do the same for all lights in the scene.
alternatively you can do the same for specific objects in the scene, if you want to limit shadowing. e.g.
[someObject addShadowVolumesForLight:yourLight];
[someObject addShadowVolumes];

waywardson07
- 31
- 2
-
p.s. for some reason shadows don't seem to work with opengles 1 on my system, but they do for opengles 2. Not sure if its a local problem or not. – waywardson07 Jan 23 '14 at 07:10