I'm trying to import an image via duke3d.def. The image has transparency (in fact it is a .gif file I originally imported in EditArt).
The wiki page simply says alphacut <value> with no hint of what <value> is.
First off, I tried setting it to 255, the palette index for transparency. When that didn't work, my brain decided to kick in and suggested it is an RGB value since def files handle 24-bit images, so I tried setting <value> to the following:
* 16515324 - the transparent colour is RGB 252,0,252 and 16515324 is (65536*252)+(0*256)+252
* 0xFC00FC
* FC00FC
* 252,0,252
* 252 0 252
Nothing works and I'm outa ideas what <value> could possibly be
TTFN,
Jon
Page 1 of 1
How to use tilefromtexture's alphacut
#1 Posted 16 November 2015 - 07:00 AM
#2 Posted 16 November 2015 - 09:32 AM
Jon, you want the gif or the PNG to display as having a 100% transparent background when viewing it in your image editor (Photoshop or whatever you are using). You don't need to use alphacut. When you put the image in game with tilefromtexture, the transparent parts should stay that way.
I think alphacut is used for partial transparency, like if there is a gradual fade out along the edges of the image. It allows you to set a level where those parts of the image will be rendered in-game as 100% transparent even if it is not at that percentage in the original image.
I think alphacut is used for partial transparency, like if there is a gradual fade out along the edges of the image. It allows you to set a level where those parts of the image will be rendered in-game as 100% transparent even if it is not at that percentage in the original image.
#3 Posted 16 November 2015 - 09:53 AM
Trooper Dan, on 16 November 2015 - 09:32 AM, said:
Jon, you want the gif or the PNG to display as having a 100% transparent background when viewing it in your image editor (Photoshop or whatever you are using). You don't need to use alphacut. When you put the image in game with tilefromtexture, the transparent parts should stay that way.
D'Oh ! I saw the alphacut setting and just assumed I needed to specify the alpha channel (the wiki could really do with a bit more info).
TTFN,
Jon
#4 Posted 06 January 2023 - 09:59 PM
Im having the same issue with the wiki. so I think I will spend some time updating the wiki based on the code.
to answer your question:
alphacut = clamp(alphacut, 0, 255);
meaning this value is an integer
- if its less than zero it returns 0
- if its greater than 255 it returns 255
- Any other value is valid from 0 to 255
to answer your question:
alphacut = clamp(alphacut, 0, 255);
meaning this value is an integer
- if its less than zero it returns 0
- if its greater than 255 it returns 255
- Any other value is valid from 0 to 255
This post has been edited by MexMeRcUrY: 06 January 2023 - 10:00 PM
Share this topic:
Page 1 of 1