sebj
20-08-2011 13:44:33
Hello,
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: http://www.ogre3d.org/docs/manual/manual_17.html#SEC81
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:
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
Thanks!
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: http://www.ogre3d.org/docs/manual/manual_17.html#SEC81
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_unit
{
texture [Diffuse Map Filename]
}
texture_unit
{
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
Thanks!