Planetside Software Forums

General => Terragen Discussion => Topic started by: cyphyr on September 19, 2007, 10:08:51 AM

Title: Transparent Images
Post by: cyphyr on September 19, 2007, 10:08:51 AM
I'm trying to use an image with an alpha channel in my texture node tree. Trouble is I cant seem to get the alpha mast to work at all! I'm sure I', just being dim but some help would be appreciated. Is this even possible. I tried a test using one of the images from the XFrog trees sampler. The Image shows alright but the transparent part shows only white (or black) not the underlying texture layer. This is exactly the same problem as I get with my own images. Oh I can also make the landscape completely transparrent apart from the areas within the alpha channel but this is not very useful !! :)
TIA
Richard
Title: Re: Transparent Images
Post by: dhavalmistry on September 19, 2007, 10:41:48 AM
did you turn on the option called "use alpha channel" in opacity tab??
Title: Re: Transparent Images
Post by: cyphyr on September 19, 2007, 10:59:18 AM
Sure did, made no useful dif. Got round the problem by using two layers of image maps, one of them as a blend shader. Not an ideal solution but it works for my purposes (see next post :D )

Richard
Title: Re: Transparent Images
Post by: Oshyan on September 19, 2007, 03:53:01 PM
What are you trying to apply the "alpha" to - terrain or object? Note that in TG2 the area to use "alpha" is actually the Opacity tab (of the Default Shader anyway).

- Oshyan
Title: Re: Transparent Images
Post by: cyphyr on September 19, 2007, 05:29:03 PM
Hi Oshyan
I was trying to produce the effect you see in my 1000/100meter overlay post http://forums.planetside.co.uk/index.php?topic=2369.0 (http://forums.planetside.co.uk/index.php?topic=2369.0) without having to use two Image shaders, one as a blend of the other. I had hoped that I could use the alpha embedded in the image (psd format) so the terrain textures would show through beneath it. Alas all I could get to work was either no texture showing through or a completely transparent terrain, interesting but useless:).
Is there a way of doing this simpler than the method I ended up using?
Thanks
Richard
Title: Re: Transparent Images
Post by: Oshyan on September 19, 2007, 05:39:17 PM
Erm, TG2 loads PSD? ;D

You should be able to use something like TIFF with alpha and have it read the opacity from the alpha channel. It's possible there's a bug that isn't allowing alpha to be read automatically - I can't check just at the moment. However in the Default Shader you can specify the same image in the Opacity Image area and that will definitely work.

- Oshyan
Title: Re: Transparent Images
Post by: cyphyr on September 19, 2007, 06:32:17 PM
Yes TG loads psd and tif and seems to read the alpha info from them correctly but its method of using that information is beyond me. As I mentioned earlier the "alphe'd" area is either showing up as opaque. ie white, or as fully transparent, ie you can see through to the alpha areas to the other side of the mountain!! :) Maybe I'm creating the alpha mask wrong, or wiring the nodes wrong. I'll post a sample when I've finished my current project.
Richard
ps sorry for typing your name wrong earlier ...  ::);)
Title: Re: Transparent Images
Post by: Oshyan on September 19, 2007, 06:48:13 PM
Yeah, post a sample. I can't imagine what's going on, hehe. Include an example image file if you can (if it's simple and small you should be able to zip it all up and include it in an attachment).

- Oshyan
Title: Re: Transparent Images
Post by: bigben on September 19, 2007, 08:03:45 PM
I had a bit of trouble with the clip. Can you post a TGD here? (I already have the images).  I posted an alternate version of your grid that may be a simpler approach but it would still help you to have your question answered for other uses.
Title: Re: Transparent Images
Post by: cyphyr on September 19, 2007, 08:41:28 PM
I'll be rendering the rest of the night but I'll be sure to post the tgd tomorrow. I think the problem is down to my understanding really. It would appear that the transparancy/alpha channel (as I was using it) is acting on the terrain surface rather than on the image itself thus making the terrain transparent, not just that part of the image on the terrain.

Richard

ps: Your version looks much more usefully than mine (one button on/off) and might be slightly less computationally intensive (slightly ) ;)