Same lighting as pview

Hi all,

I am having problems with my Sketchup exported models (*.dae -> *.egg). In my own setup I use ambient light. At first the model was completely white. Thanks to some other posts in this forum I figured out that it has to do with the ambient light settings in the *.egg file.
I changed the file manually from:

  <Scalar> diffr { 0.698039 }
  <Scalar> diffg { 0.133333 }
  <Scalar> diffb { 0.133333 }
  <Scalar> ambr { 0.0 }
  <Scalar> ambg { 0.0 }
  <Scalar> ambb { 0.0 }
  <Scalar> emitr { 0 }
  <Scalar> emitg { 0 }
  <Scalar> emitb { 0 }
  <Scalar> specr { 0 }
  <Scalar> specg { 0 }
  <Scalar> specb { 0 }
  <Scalar> shininess { 20 }

to:

  <Scalar> diffr { 0.698039 }
  <Scalar> diffg { 0.133333 }
  <Scalar> diffb { 0.133333 }
  <Scalar> ambr { 0.698039 }
  <Scalar> ambg { 0.133333 }
  <Scalar> ambb { 0.133333 }
  <Scalar> emitr { 0 }
  <Scalar> emitg { 0 }
  <Scalar> emitb { 0 }
  <Scalar> specr { 0 }
  <Scalar> specg { 0 }
  <Scalar> specb { 0 }
  <Scalar> shininess { 20 }

Now it shows the model but it looks crappy. See this Screenshot http://imageshack.us/photo/my-images/404/ownsetup.jpg

When I load the unchanged model with pview and press “l” for lighting the model looks much better. See this Screenshot: http://imageshack.us/photo/my-images/259/pview.jpg/

So my question is: How can I code the same lighting conditions as pview uses when pressing “l” ?

Thanks in advance

Matthias

Do you have any actual lights in your scene? Or lights other than Ambient, like Point, Spot or Directional? The model (which is very nice, btw) looks like it’s not lit at all, or lit only by ambient light, and those pieces of Egg file are the material settings, not lights. Lights are not saved in Egg files.

There are no other lights than ambient light in the scene. I played around with the other types of light but they all don’t light up the scene as bright as I would like. PView on the other hand seems to use real lights but I don’t know how to get the “full scene light up” result.

You can’t get specular effects with just an ambient light. Pressing L in pview enables both an ambient light and a directional light. The placement and colour of the light is always crucial in getting a good effect. Games will usually at least have an ambient light and two other light sources for outdoor scenes.

Thank you very much for your replies. I now tried to use a directional light and the scene looks much better!

Could you show us the outcome picture

How to get specular effect?
and generally how to get vray/mental ray quality in Panda?

This is what it looks like now:

imageshack.us/photo/my-images/190/resultqq.jpg

It’s fine for my purposes.

Honestly, I would expect a much better quality, maybe having solely ambient and one directional light is not enough.
Are u using normal mapping?
By the way is this low polygon model?

The target should be something like
bibliocad.com/library/car–bmw—3d_35585
or
exchange3d.com/index.php?act … ctId=16074

How to get them into Panda???

Yes, it is a low poly model from the 3D Warehouse. I exported it to collada and then converted it via dae2egg.

several things.
1.your model only has surface-normals, not vetrex normals, thus it looks quite edgy.

2.panda is not a raytracer, so any effects produced by raytracing needs to be carefully recreated. in your case that is a reflection and/or gloss map + texture

3.you might want to bake a texture with the model’s own ambient occlusion, it does a lot good for adding realism and making small details blend in better.

normal mapping would be of no use in this case, as pretty much all surface normals match with the geometry already.

as rdb already said, light setup is critical , if you are going to use lights.

last but not least, if you dont want to use lights you can still use something i would call “light cubes”. from an old test of mine that does not include reflections, but could be added: thomaseg1.p3dp.com/samples/light-cubes.tar.lzma
it is a bit like static reflection maps for lights.

Thank you tomas -
Don’t quite understand your code

cube_map_#.png’ I have 6 files cube_map_0.png,… upto 5. I suppose that this _# refers to the 6 faces of the cube, ok?
how do you generate it and why do you apply it directly to the model (since it seems like a skybox), is this a poorman trick to modulate the local intensity with the cube color values?

What about the uv then, are they stored in your various lightmap files? How does this merge with the cube_map?

Should you run this with autoshader on?

the code loades a cubemap, creates a new texture stage, sets the texture stage to “multiply”, adds a texture, and enables automatic UV generation for that texture stage.

all previous textures are left untouched. there is no autoshader needed for this. i dont even know if it works with autoshader enabled.

the idea behind this cube-light map is that a surface pointing i a certain direction, receives a certain color/ammount of light. you can draw those light-cubes yourself, or generate them on the fly.

i came up with this to fake HDR lighting on low end hardware, instead of dragging in real HDR maps, i broke the lighting down on how it would affect a diffuse sphere, and map the result back into a cubemap.

it pretty much ‘bakes’ the entire diffuse light situation in your scene into a cubemap.

if you do the same with reflections, things will start to look pretty neat.

i have yet to try this on a really high quality model and with good input maps.

Thank you Tomas -
I will try and play a liitle bit with this to see if i can manage to get some nice stuffe
Tonio