Lights direction and intensity problem
3 posters
Lights direction and intensity problem
Hi,
I'm pretty new to Sio2 so apologies if I'm missing something obvious. I've been through the lights tutorial, and got it working fine, but now I'm working on a project of my own with lights and I'm having trouble.
Basically, there are two problems. The first problem is that the intensity of the lights is much lower in the iPhone than in Blender. I have to blast the lights to their full energy to get them to show up at all on the iPhone. There's no mist or anything, so I'm not sure what's going on.
The other problem is that the illumination is not coming from the correct direction. I have the lights placed to the right and left of an object. I've used the method of drawing a colored point at the location of the lights to visually make sure that the lights are where I want them, and this appears to tell me that the lights themselves are in the right place. However, the object is being lit from some light source directly below it. There's no light coming from the right and left.
I hope this was clear enough. I can attach some images too if it would help. Anybody know what could be causing such a problem?
T
I'm pretty new to Sio2 so apologies if I'm missing something obvious. I've been through the lights tutorial, and got it working fine, but now I'm working on a project of my own with lights and I'm having trouble.
Basically, there are two problems. The first problem is that the intensity of the lights is much lower in the iPhone than in Blender. I have to blast the lights to their full energy to get them to show up at all on the iPhone. There's no mist or anything, so I'm not sure what's going on.
The other problem is that the illumination is not coming from the correct direction. I have the lights placed to the right and left of an object. I've used the method of drawing a colored point at the location of the lights to visually make sure that the lights are where I want them, and this appears to tell me that the lights themselves are in the right place. However, the object is being lit from some light source directly below it. There's no light coming from the right and left.
I hope this was clear enough. I can attach some images too if it would help. Anybody know what could be causing such a problem?
T
bugman_2000- Posts : 14
Join date : 2009-04-30
Re: Lights direction and intensity problem
You need to export the normals dude... check the video tutorial08... I explain that specifically...
Cheers,
Cheers,
Re: Lights direction and intensity problem
Hey, thanks!
Indeed, you did explain it. It just slipped my mind. Things are looking much better now!
T
Indeed, you did explain it. It just slipped my mind. Things are looking much better now!
T
bugman_2000- Posts : 14
Join date : 2009-04-30
Re: Lights direction and intensity problem
I realized one thing few days ago - there is a "problem" with sun light type. In fact with direction - It is inverted. Before export my scenes I have to rotate my sun in to opposite direction if I want same results in SIO2 as in Blender. Never use spots so have no idea if there is same issue. Anyway lamps are ok Just for information, maybe someone already post about it - if Yes excuse and delete post.
_-MADMAN-_- Posts : 52
Join date : 2009-04-23
Re: Lights direction and intensity problem
I have no idea how looks blender internal data of lights and how it is translated to sio, but It looks like Blender sun direction is:
FROM light point TO light distance end
And sio take it as:
FROM light distance end TO light point
So light direction is "inverted". In fact, from explorations, it has nothing to do with rotation and location of the light. I'm not sure about rotation, couse blender light direction is strictly binded to rotation and there is no way to change dir without rot. Anyway, all this issues are tested with sunlight type.
Hope it's clear and helpful.
Regards,
Mad
FROM light point TO light distance end
And sio take it as:
FROM light distance end TO light point
So light direction is "inverted". In fact, from explorations, it has nothing to do with rotation and location of the light. I'm not sure about rotation, couse blender light direction is strictly binded to rotation and there is no way to change dir without rot. Anyway, all this issues are tested with sunlight type.
Hope it's clear and helpful.
Regards,
Mad
_-MADMAN-_- Posts : 52
Join date : 2009-04-23
Re: Lights direction and intensity problem
Are you sure cuz checking from the exporter that direction vector seems to be correctly exported:
- Code:
#===============================
# DIRECTION
#===============================
tar = ( Blender.Mathutils.Vector( 0.0, 0.0, -1.0 ) * obj.matrixWorld )
loc = Blender.Mathutils.Vector( obj.loc[0], obj.loc[1], obj.loc[2] )
dir = tar - loc
buffer = "\td( %s %s %s )\n" % ( optimize_float( dir.x ),
optimize_float( dir.y ),
optimize_float( dir.z ) )
f.write( buffer )
Re: Lights direction and intensity problem
As I said - I do not now how it works inside. I working in blender about eight years and there is one thing I have learned - Blender is always different One thing is clear - all levels with sunlight after export are with sun from the ground in sio. So I simple rotate sun and In blender I have light from the ground... but in sio is ok
_-MADMAN-_- Posts : 52
Join date : 2009-04-23
Re: Lights direction and intensity problem
i think your problem is coming from somewhere else... cuz the direction vector calculation is ok... are you sure that your normals are pointing the good direction?
Re: Lights direction and intensity problem
Yep, I'm working in texture not glsl mode, so I see one side faces... anyway nvector draw shows that they are ok. Hmmm - in Your machine everything is ok with sun export? Maybe it's problem with my blender or something (I'm using tests builds with new features, but had same issue with 2.48a).
_-MADMAN-_- Posts : 52
Join date : 2009-04-23
Re: Lights direction and intensity problem
Yep, I'm working in texture not glsl mode,
>> What does that mean?
Hmmm - in Your machine everything is ok with sun export?
>> The same calculation is used for sun, spot, camera etc... if it work for the camera it will work with the sun...
>> What does that mean?
Hmmm - in Your machine everything is ok with sun export?
>> The same calculation is used for sun, spot, camera etc... if it work for the camera it will work with the sun...
Re: Lights direction and intensity problem
In Game panel You can change viewport and BGE display mode - in glsl You can see shaders and faces are double sided, so without "draw normals" You can't see witch side will be drawn in sio2. Anyway - textured mode draw same as sio - one sided faces, pervertex lightning, alpha and vertex light intensity (no spec).
No idea why direction is inverted. I will try it with spots and report.
No idea why direction is inverted. I will try it with spots and report.
_-MADMAN-_- Posts : 52
Join date : 2009-04-23
Similar topics
» Max lights
» Parenting lights
» Lights and rotated object
» Lights - face flicking
» How to set particle direction ?
» Parenting lights
» Lights and rotated object
» Lights - face flicking
» How to set particle direction ?
Permissions in this forum:
You cannot reply to topics in this forum