Material scripts: texture option 'alpha' with multi-channels


20-08-2011 13:44:33


I am writing a 3DSMax -> Ogre Material script exporter, the first version is almost complete, but I wondered if someone could explain to me more about the 'alpha' option in the texture declaration:

One case I am thinking of, is when a model has a diffuse map & an alpha map, where the alpha value of that map is taken to be the luminance of the RGB channels; in this case my exporter declares the textures like so:

texture [Diffuse Map Filename]
texture [Opacity Map Filename] alpha
alpha_op_ex source1 src_texture src_current
colour_op_ex source2 src_texture src_current

This works but only if I manually add an alpha channel to the Opacity Map (where the channel is just a copy of one of the other channels)

So I am wondering,

1. Is it that the alpha option only works if the map is indeed a single channel? (i.e. I can't provide a 3-4 channel map and assume that Ogre shall only use the first channel?)
2. Why does it work when I provide an opacity map with an alpha channel instead of simply breaking? Does the alpha option get ignored if a multi-channel map is provided?

I know its unlikely anyone will actually want to texture an asset like this but Max supports and one of my test models uses it so if its a really quick modification I would like to as well for completeness if nothing else ;)



21-08-2011 17:59:22

I can't answer this question, but have a good suggestion:
The question is not Mogre specific. So you can re-post it in the Ogre main forum. There are much more users and you have a high chance to get a useful answer. :wink:

There still exists an exporter (or even two?) for export from 3DSMax.
Is this exporter bad for material or are you aware of the price?


22-08-2011 19:08:20

Hi Beauty,

I will repost now. Thanks!

Is this exporter bad for material or are you aware of the price? :D

I am aware of two exporters, Obfusion and OgreMax. Obfusion looks awesome and I will try it, but for now it looks a little advanced as i'm still trying to learn the engine, also it adds another stage to the pipeline, and finally I always like to have two ways of doing things in case one breaks for some reason (e.g. I model something in a format it doesn't understand, or the free version disappears)

OgreMax I've tried and that is a great geometry exporter (I think anyway, so far I've only exported static geometry), but as you guessed the material export is slightly simple, for example not supporting things such as dual-pass alpha blending, multiple maps, and properties like emissive colours; so I thought I'd write a script to (at least start to) fill in the gaps.