Transparent color channel

I am a new user of MaxScript.

1- I need to apply an image with a transparent color # 185 With rgb 255 0 255
the image is used also in POV_Ray
...
texture
{
pigment
{
image_map
{
gif ImageFile
once
transmit 185, 1.0 // rgb 255 0 255
}
}
}
...
2- with this I am able to display the image but with the transparent color
...
theBmp = openBitMap "Image.gif"
meditMaterials[23] = RaytraceMaterial ()
meditMaterials[23].diffusemap = bitmapTexture()
meditMaterials[23].diffusemap.bitmap = theBmp
meditMaterials[23].showInViewport = true
...
cylinder ...
material:meditMaterials[23]

3- I need help.

amelia

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anubis's picture

Then dont store alpha

Then dont store alpha channel in your bitmaps.
See attached shot below.

AttachmentSize
tiff_sets_noalpha.png 2.93 KB

my recent MAXScripts RSS (archive here)

amelia's picture

I changed all from

I changed all from "diffuseMap" to "opacityMap" on above script.
The image is displayed with transparency OK, but with "gray scale" color.
I am a beginner, please continue to help me.
Thanks.

amelia

Anubis's picture

This was asked many times

This was asked many times from the first Max release to the pressent days and answer is still the same -- Alpha channel can not be displayed through Diffuse. Use Opacity. :)

my recent MAXScripts RSS (archive here)

amelia's picture

my actual

my actual step:
*******************************************************
manual steps to display an image with transparent areas

1: select a free material
2: set "diffuse color" RGB that will be visible through
the "holes" of the image
3: select Maps->"Diffuse Color", Map-Bitmap->image.tga
4: deselect "Coordinates->Tile U V"
5: select "Standard Map in Viewport"
6: create a plane
7: apply the new material **OK**
*******************************************************
MAXScript to display an image with transparent areas

cc = 2
theBmp = openBitMap "....image.tga"

meditMaterials[cc].shaderType = 2
meditMaterials[cc].diffuse = color 0 196 196 --back color
meditMaterials[cc].diffuseMapEnable = true
meditMaterials[cc].diffuseMap = bitmapTexture()
meditMaterials[cc].diffuseMap.bitmap = theBmp
--meditMaterials[cc].diffuseMap.enabled = true --ERROR--
meditMaterials[cc].diffuseMap.filtering = 0 -- 0:Pyramidal 1:Summed Ara 2:None
meditMaterials[cc].diffuseMap.monoOutput = 1 -- 0:RGB 1:Alpha Channel
meditMaterials[cc].diffuseMap.RGBOutput = 0 -- 0:RGB 1:Alpha
meditMaterials[cc].diffuseMap.apply = true -- 0:crop OFF 1:ON
meditMaterials[cc].diffuseMap.cropPlace = 0 -- 0:Crop 1:Place
meditMaterials[cc].diffuseMap.alphasource = 0 -- 0:Alpha 1:Gray 2:Opaque
meditMaterials[cc].diffuseMap.preMultAlpha = false
meditMaterials[cc].diffuseMap.coordinates.V_Tile = false
meditMaterials[cc].diffuseMap.coordinates.U_Tile = false
meditMaterials[cc].diffuseMap.coordinates.V_Tiling = 1.0
meditMaterials[cc].diffuseMap.coordinates.U_Tiling = 1.0
meditMaterials[cc].diffuseMap.viewImage()
meditMaterials[cc].showInViewport = true

p = plane width:8.0 \
length:2.0 \
pos:[0.0,0.0, 0.010] \
material:meditMaterials[cc]\
showInViewport:true

*******************************************************
at the end, the trasnparent areas will be "black" (the Alpha mask displayed ???)
the only difference in the "Material Editor->Maps" rollout parameters is:
manual =
v Diffuse Color Map#1(image.tga)
MAXScript =
v Diffuse Color Bitmaptexture(image.tga)
*******************************************************

Any suggestions ?

Thanks.

amelia

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.