I have problem with lights. I found that there are 2 types of lights 'local' and 'global'. Also I found that by default x3d format supposes lights are global.
But when I load model with lights on it, lights acts like they are local. So I have very bright torch which doesn't shine around. I didn't found examples about models with lights. Can you help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, X3D specification says that DirectionalLight is by default local (affects only sibling nodes in X3D node graph), while PointLight and SpotLight are global (affect everything; of course they are still limited by stuff like PointLight.radius).
X3D spec gives default value for "global" field, which is "false" for DirectionalLight. Note that you can always change the "global" field value.
And we support all combinations in our engine and view3dscene, as far as I tested. Default values are honored according to X3D specification, and explicitly changing the "global" field also works :) If it doesn't, please submit a test X3D model where it fails.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello!
I have problem with lights. I found that there are 2 types of lights 'local' and 'global'. Also I found that by default x3d format supposes lights are global.
But when I load model with lights on it, lights acts like they are local. So I have very bright torch which doesn't shine around. I didn't found examples about models with lights. Can you help?
Actually, X3D specification says that DirectionalLight is by default local (affects only sibling nodes in X3D node graph), while PointLight and SpotLight are global (affect everything; of course they are still limited by stuff like PointLight.radius).
See http://castle-engine.sourceforge.net/x3d_implementation_lighting.php and X3D spec:
X3D spec gives default value for "global" field, which is "false" for DirectionalLight. Note that you can always change the "global" field value.
And we support all combinations in our engine and view3dscene, as far as I tested. Default values are honored according to X3D specification, and explicitly changing the "global" field also works :) If it doesn't, please submit a test X3D model where it fails.