PDA

View Full Version : Max -> Vizard, Two Sided Textures


shivanangel
11-18-2008, 11:36 AM
Hello,

I am trying to move textures from Max to Vizard using the IVE format.
In Max I have set up a series of planes with grass textures.
These textures are .tga files with an alpha channel.

My aim is to create a forest with a bunch of these grass textures at
perpendicular to one another.

My problem is that regardless of the settings I have so far put into Max
my planes come out in Vizard with only one side visible. If I move
to the opposite side the grass planes completely disappear.

Is there a simple flag I can set to enable 2-sided textures?

Thanks,
George

shivanangel
11-18-2008, 12:15 PM
Quick Fix:

Disabled Backface Culling on the models.

Thanks,
George

Veleno
11-18-2008, 12:51 PM
Hi shivanangel,

To disable backface culling on all objects with a particular material, check "2-sided" in that material's "shader basic parameters" in max's Material Editor.

To disable it by object, go to the helpers part of the modify panel, select "openscenegraph" as the object type, and create a stateset modifier. Add the objects to stateset modifier and make sure the box that says "cull face" in the GL Mode rollout is unchecked.


Making grass they way you described is probably going to give you some transparency problems that cause the background color of the scene to show through. This happens whenever partially transparent objects intersect each other. This can be solved by applying the following code to your exported model:


import viz
viz.setMultiSample(4) #lower multisample = lower quality, higher framerate, and vice versa

viz.go()

trans = viz.add('00.ive')

GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E
trans.disable(viz.BLEND)
trans.enable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB)
trans.draworder(0)


I recommend exporting the grass and other similar objects as a separate export and applying only to that. In most cases glass should not need this unless you have all the glass in a scene as one object or are getting transparency problems. Glass should also have its own export since it may need a higher sampling rate to look good than the grass does.

shivanangel
11-18-2008, 03:28 PM
Wow, awesome advice.

You answered the question I had yet to ask!

~George

Gladsomebeast
12-02-2008, 10:11 PM
Michael,

What do you mean by: "Glass should also have its own export since it may need a higher sampling rate to look good than the grass does."

What is sampling rate and why does a separate export increase this?

Veleno
12-04-2008, 03:15 AM
Rate wasn't the right word for me to use, but basically I was saying that something like grass or a leaf that just has alpha on it's edges and doesn't have any big obvious gradient alphas can get away with a lower multisample value than something like glass that is transparent all over. It needs to be even higher to look good the alpha is a gradient that needs to have a lot of different steps to its opacity.

Now that I think about it...i'm not sure if you're able to set different amounts for multisample for different models. If you only get to set one value, then I'd say avoid situations where you'd need to set it high for things to look good and try to stick to regular alpha blending for glass and similar objects.