PDA

View Full Version : basic lighting question


malte
05-25-2010, 08:05 AM
Hi,
not being an expert in lighting, GL, etc. this may be a very simple question.

I need to create rather simple environments for experiments. Currently I use Sketchup to create those and then export them to either 3ds or vrml.
After loading them into Vizard, the lighting is really not what I am looking for.
I understand that there is a head-light by default and that I can add other light sources. However, the lighting appears to be polygon based rather than pixel based (obviously this gives strange artifacts when moving through the environment -> entire polygons turn black when turning etc - even after diabling the head-light). Is there any option I have overlooked so far to change lighting to be pixel based rather than polygon based?

An alternative that I used earlier was to use no light source at all, but to make all the materials emissive. I know that this does not give a natural lighting, but for many experiments it is sufficient and I do not have to worry about different lightintensities depending on where I place my lights. However, I have not yet figured out how to make materials emissive in Sketchup (I understand that this is not a Sketchup forum, but maybe one of you has an answer).

I would appreciate any help,
thanks in advance,
malte

Jeff
05-25-2010, 02:47 PM
You can illuminate objects using Vizard's <node3D>.emissive command. Does that work for your application?

malte
05-26-2010, 04:05 AM
Many thanks for the quick response.
<node3D>.emissive command works. However, is it possible to adjust the intensity? Currently the entire environment is extremely bright (even if I use rgb values [120 120 120]) and the textures are not visible any more.

Jeff
05-26-2010, 11:13 AM
Try passing different values into the emissive command. Does something like this work for you?
import viz
viz.go()

male = viz.add('vcc_male.cfg',pos=[0,0,5],euler=[180,0,0])
male.state(1)

headLight = viz.MainView.getHeadLight()
headLight.disable()

slider = viz.addSlider()
slider.setPosition(0.2,0.2)

def changeLight(pos):
male.emissive([pos]*3)

vizact.onslider(slider,changeLight)

malte
05-28-2010, 02:26 AM
yes that works fine,
thank you very much!

natalia
11-26-2010, 05:39 AM
Hello, we also used Sketchup to create a model of metro. I have to add now the lighting inside the carrige, which should be close to the real one, with light reflections from the walls and so on. Is it possible? Or there is no light reflection function in Vizard?:confused:
I tried to add some point lights with attenuation, but some surfaces remain black.
Can you give me an advice?
Thank you in advance,
Natalia

Jeff
12-01-2010, 12:25 PM
It sounds like you want baked lighting. There is a workflow for this through 3ds Max but as far as I know SketchUp does not support this. However, there are a lot of plugins for SketchUp available which add a lot more functionality, so it's possible one adds baking capabilities. If you also have 3ds Max take a look at the following article:

http://kb.worldviz.com/articles/1222