Sign in to follow this  

lighting + shaders question

This topic is 1894 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:
[img]http://s13.postimage.org/pw2t1fmpj/Capture.jpg[/img]

So, my [b]question is: [/b]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. Edited by DmitryNik

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this