Skip to main content
GameDev.net gamedev.net
🔒 Locked

lighting + shaders question

Started by DmitryNik Nov 9, 2012 at 11:40 AM 1 replies 1.2k views
Original Post
DmitryNik
DmitryNik
Hello.

I've created a very small scene with almost my(I've used some tutorials online for syntax and some basic "game" rules) very first shader. The scene contains 3 meshes: 2 lanterns and one base(everything is loaded from fbx. Fbx created with Blender). Also XNA was used for the scene creating. OK. Here is the small problem: since the scene contains 3 different meshes they a drawn separately and because of that the light spot can go under the mesh, like this:
Capture.jpg

So, my question is: How can be done so that the light spot also goes onto the lantern and I still could keep three separate meshes? Something like on the picture below(I've drawn it in the paint):
[attachment=12184:Capture.JPG]


Thank you for your answers beforehand.
WhiskyJoe
WhiskyJoe
I'm not really sure what you're specifically going for, but if I understand right; you want the lighting to affect all 3 meshes even if it is inside one of the meshes?

If that's the case, you will need to replace the light if it's within a mesh so the shader can calculate it correctly. If the light is in front of the scene, kind of where the camera is now, the scene should already be lit properly unless your normals are incorrect or your shader code.

Perhaps you can render the light and/or where it should be so we know where you exactly where it should be with the effect you want to have.
DmitryNik
DmitryNik
Thank you for your answer. Good suggestion. I have to try it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.