Duke4.net Forums: How to use tilefromtexture's alphacut - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to use tilefromtexture's alphacut

#1

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
0

User is offline   Danukem 

  • Duke Plus Developer

#2

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.
1

#3

View PostTrooper 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
0

User is offline   MexMeRcUrY 

#4

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

This post has been edited by MexMeRcUrY: 06 January 2023 - 10:00 PM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options