So I’ve been having a really hard time casting light onto the inside of a hemisphere (created by chopping a UV sphere in half). At first I couldn’t even SEE the inside of the hemisphere, but after a fair amount of research I found out that I needed to make all the faces in the sphere two sided and the only way I could find to do that was to modify a script I found online, resulting in:
mesh = bpy.context.selected_objects[0].data
faces = mesh.uv_textures['UVTex']
for face in faces.data:
face.use_twoside = True
Now at least I can see the inside of my sphere, but it still only receives light cast on the outside of the hemisphere. Does anyone know how I can solve my problem?
Thanks in advance for any help you’re able to offer!
I have no idea what your actual problem is.
If I add a UV sphere and create a hemisphere by deleting half of it in the default scene, add a material it shows twosided in the viewport and if I press F12 to render, it´s shaded and has shadows and lights on both sides of the quads.
Sorry my mistake, I forgot to mention this is being done in the game engine. Yes, it works fine when rendering, but I cant get the inside of the hemisphere to reflect light in the game engine.
An object’s faces have what are called “normals”. This is a direction used to calculate interaction with light. To see the current normals on an object, in edit mode, press “N” to bring up the properties area and under “Mesh Display” select “Normals > Face”. You will then see lines from the face outwards showing the direction of the normals. I suspect that they may be facing “outside” the sphere. Again in editing mode, in the tools, select all faces and click the Normals > Flip Direction button. Now the normals face inwards. When you now see in the game engine, the interior may now be shown.
Select your object.
Go in edit mode.
Select all faces.
Go to the “object data tab” (the triangle icon, 3edges, 3 vertices, upsidedown left of materials)
There you´ll see “double sided” it´s on by default.
Further down you´ll see “texture face” - it´s only visible in edit mode.
There you see two-side. Check it.
If you exit edit mode and if you got GLSL on, you should already see both sides of the faces textured.
And it obviously requires UVW mapping. And if I am not mistaken it also works in BGE.
You should ask this kind of questions in the BGE subforums.