Problems with level rendering

Hi everybody

Today I decide to load an entire level with panda, but I am having this problem, when I run my script, the environment doesn’t look good, it seems to be with a dense fog, even without using fog in my script.

This is what I get:

This is what I have with blender:

Can anyone help me please? Thx :wink:

Looks rather like transparency to me.

David

So, how can I fix this? :astonished:

You’ll have to figure out exactly where the problem is first.

Is it in your egg files? What happens if you just pview an egg file? Do you get the same problem?

Is it in your script? What happens if you load a single egg file in Python and parent it to render?

Are you loading multiple egg files and parenting them together, or is it coming from just one egg file?

You can also try to determine whether it’s transparency or fog by changing the background color, or looking at it from different points of view or bringing the camera closer.

David

I have no idea what the problem is

  • When I call pview I get the same problem

  • When I load other model, for example a single house it appears normaly

  • The level is a single file, I am loading it as a single file

  • If I change background color I get the same problem, if I bring the camera closer the problem remains

Thx

Well, see, now you have some idea.

This tells you the problem is not in your python code. It must therefore be in the model. Perhaps the max converter put some transparency on your vertices, for some reason; or perhaps you have an alpha channel on some of your textures.

Sounds like it would be useful to compare closely the single house model with your larger model, to see how they differ. What is the larger model? Is it some aggregate of the single house model plus additional models, or is it something completely different?

The point of this is to see in what way the problem changes. If it is a transparency problem, than changing the background color will also change the color you see through the models. For instance, in the screenshot above, the models look like they’ve got too much gray in them, but the background is also gray. If you make the background color black, and then the models also look like they’ve got too much black in them now, it means you’re really seeing the background color through the models–suggesting a transparency problem, not a fog problem. (Changing the background color doesn’t affect the color of fog.) Similarly, fog goes away when you get close to a model, so since that doesn’t happen, it also suggests a transparency problem, not a fog problem.

So, it appears we have a transparency problem. You can prove this in Python code, by loading the model and doing something like:

model.setTransparency(False, 100)

which disables all transparency on the model with an override of 100 (you would have to have a higher override lower down to re-enable transparency on a particular node). If that repairs the problem, it’s final proof that you’ve got transparency going on.

So, where does the transparency come from? Either the entries in the egg file (the fourth parameter), or the alpha channel on your textures. Check carefully for both of these.

David

Now it works, thx!

I am not happy with the quality, is it possible to improve the quality of rendering for not showing these strangers effects on the patern tilled floor?

I am talking about this effects on the floor:

Yes. You just need to choose a better filter mode for the texture. I don’t know what filter mode the Max converter specifies by default; but you probably want to have trilinear mipmapping enabled.

To do this, either hand-edit the egg file, and add the line:

<Scalar> minfilter { linear_mipmap_linear }

within the entry in question, or at runtime load the model and do something like this:

tex = model.findTexture('myTexName')
tex.setMinfilter(tex.FTLinearMipmapLinear)

You can also set the various texture filter modes using egg-palettize, but I suspect that tool may be more involved than you are interested in getting right now.

David

Many thanks David, after set up some filters as you said, my scene now looks good, it is almost the same tha I have in blender!

Now what I get:

Another pic:

As I always say in braziliam game dev websites: Try out Panda3D!

Oops, I don’t know why I thought you were using Max.

It should have come out looking almost the same out of the box! Since it didn’t, it indicates some minor bugs in Chicken. For instance, Chicken should have set the minfilter automatically to match the filter type you see in Blender.

What was the situation with the transparency; did you figure out where the transparency was coming from? Was this another Chicken bug, or was there something else?

David

the transparency in chicken appears when you use the Ambient occlusion to bake shading into vertex colors. it also bakes in the alpha-value.
this is quite nasty but quite easy to fix in the chicken script.

A while back i download the same blender level and could not get it to work. Its nice that you got that working! Can you post (or email starplant at gmail.com) the egg and the texture file for other people to use?
Much appreciated!