Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / Tiff Alpha Ignored in Shader
  RSS 2.0 ATOM  

Tiff Alpha Ignored in Shader
Rate this thread
 
37313
 
Permlink of this thread  
avatar
  • mkelly4ca
  • Posted: 01 December 2009 09:48 AM
  • Total Posts: 14
  • Joined: 07 October 2009 12:57 PM

In my scripted material, the sampler (tex2D) always returns 1 for alpha when the texture is a Tiff.  If I convert the .tif file to a .tga or .bmp, it works correctly.  The texture is set via something like:

tex selectbitmap caption"Select Texture"
delegate.MyTex tex

tex.hasAlpha is true for the .tif files, and yet the alpha channel doesn’t seem to be making it to the shader.  tex2D(MySampler, uv).a is always 1.

The only way I’ve come up with to fix this is to save a copy of the .tif as a temporary .bmp or .tga file for viewing.  Is there a better way?

Thanks,

Mike.



Replies: 0
avatar
  • mkelly4ca
  • Posted: 01 December 2009 01:20 PM

I am now saving the selected .tif file as a temporary .tga file for viewing.  This works, but it litters our directories with temporary files, and it’s problematic when loading a saved max file when the temporary file doesn’t exist (see my other post “Missing External File That Isn’t").

Is there some other way to get the shader to recognize the alpha channel in a .tif?

Thanks,

Mike.



Replies: 0