PDA

View Full Version : Alpha "Decal" problems



chrisdz
10-28-2004, 03:23 PM
Okay, I've gone through this every reasonable way I can think of - and searched the forums to see older (unresolved) threads on the same issue...

I'm using LW8 and I'm trying to do something that I assume is very simple - I need to apply a "decal" to the surface of a model. This is just a simple image with an alpha channel, being overlaid onto an existing surface - the goal being to have the alpha cut out the image and leave the remaining space "empty".

I've saved the file out as TGA 32 with an alpha channel, and when I view the image in the image viewer and flip to "alpha only" I can even see the alpha channel displayed correctly. When I set the alpha state to "enabled" and place the image into a color channel on the object, I get a big white box all the way around the shape. Normally I'd just stick it onto a specific set of polygons and be done with it - but it's an irregular shape, and the alpha mask for transparency is essential.

I've shuffled this around a dozen ways and still not gotten it to result in anything except a white box behind my object... what am I doing wrong?

Thomas M.
10-28-2004, 05:44 PM
I don't know if it works your way. Usually I work with 24bit tif-files and a grey scale alpha image. Then use 2 layers in the surface editor. 1 normal, the other 1 above it as an alpha. Works for sure. Take care of the edge or repeat settings.

Cheers
Thomas

theo
10-28-2004, 06:57 PM
First off you don't need two layers to texture a decal image.

If you are using Photoshop- create an alpha channel within the image file you are using to create the decal then save the file as a PSD with alpha channels checked on the save menu. Import the baby and you are in biz. With LW supporting PSD's you really don't even have to use tga's, unless you want to of course.

The question I have is, is the white showing AFTER the actual render or is it showing within Layout and Modeller BEFORE render.

Triple G
10-29-2004, 01:51 AM
I haven't used 8, but with 7.5, LW is strange in that depending on what you're using the image for, it treats alpha channels differently. (Or at least it seems like it at first).

Try doing a simple test of making a 512px x 512px image in Photoshop. Fill it with red polka-dots. Select all your dots and click on the create new channel button to create an alpha channel. As you'd expect, the channel is white where the dots are, and black where they are not. Nothing unusual so far. Save a psd with an embedded alpha channel, and also save a black/white image of your alpha channel as a separate file.

Now in modeler, make your test object....a 1m cube in this case. Bring it into Layout and apply some sort of procedural as your base texture....I used turbulence and colored it blue. Apply your polka-dot image as a cubic mapped texture. In the Image Editor, make sure that the alpha channel is enabled. Render, and it's just as you would expect....you get your red dots, and in between, the turbulence texture shows through. LW is treating the black as opaque and the white as transparent. So far so good.

Here's where the perceived weirdness comes in. Try taking your black and white alpha image that you saved previously and apply it as a transparency map. In it, the dots are white and the background is black, so....you might expect to be able to see only what's inside the white areas (so your render would show nothing but the red dots). This however is not the case...in fact the render shows the exact opposite taking place...you're left with a cube with a bunch of holes in it. This often gets people (got me too for a while), but it makes sense when you think about it. Since the map you're applying is to control the percentage of transparency, it makes sense that the white areas are considered 100% transparent and therefore become "holes" in your object.

Really the only reason to bring in an RGB image and a separate 8-bit alpha image is so you can more easily invert your alpha channel if you need to (handy when doing lots of layered texturing). Alternatively, you could just bring in your image with the embedded alpha, and in LW's Image Editor, clone it and tell the clone to use "Alpha Only", since if you don't make a separate clone, you'll be inverting both your alpha AND the rgb information....not usually what you want. Neither way's right or wrong....just different ways of accomplishing the same thing. :)

Matt
10-29-2004, 10:47 AM
Just did a quick test ...

Mapped the logo as normal in the 'Color' channel

Mapped a black and white copy of the logo and set it to 'Alpha'. It then knocks out the unwanted parts of the image.

Here are the settings in the 'Texture Editor'

chrisdz
10-29-2004, 12:54 PM
Just did a quick test ...

Mapped the logo as normal in the 'Color' channel

Mapped a black and white copy of the logo and set it to 'Alpha'. It then knocks out the unwanted parts of the image.

Here are the settings in the 'Texture Editor'

Thanks, Matt - I had worked my way around to that solution (after waaaaay too much screwing around) and it behaved in a basic sense... but I'm curious if you run into the same problem that I do with this setup (for whatever reason).

If I have *any* specularity on the alpha-clipped surfaces at all, they show up in the render. They're still "invisible" and show through to the background as though they aren't there... but they catch specular highlights. I'll end up with my nicely trimmed photoshop object floating in space and casting shadows just as intended... but it will have a big square around it of just specular highlights floating in space.

DOH.

Matt
10-29-2004, 01:03 PM
I know what you mean, I mapped a decal on a glass surface once and the background that should've been clipped was still slightly visible, from memory I think I just copied the alpha onto the spec' channel. I think I had to play with the 'mode' the alpha was affecting the spec'.

I'd post some renders but my dongle is at work so LW runs in discovery mode (along with the checkered pattern).

All I know is that it is possible to do, just need to play with the settings!

theo
10-29-2004, 02:32 PM
I must be missing something here in this thread because decaling is easy as pie- so forgive me if I seem dense as I post this image to explain just how easy decaling is-

mgrusin
11-05-2004, 09:32 AM
Theo, which version of Photoshop are you using?

I'm using a really old version (5 "SE" which came with some hardware). Like others, I have to jump through various hoops to get alpha transparency into LW, maybe this (old version) is the problem.

From your image, one difference I see is that my .PSDs come into LW with a white background, not black as yours are. That's a pretty sweet workflow, :rolleyes: Unless I'm missing something obvious, that doesn't work for me. I have to go into Image Editor, clone the .PSD, change the clone to "Alpha only", and load the clone into the Transparency channel. Not a -whole- lot of extra work, but it would sure be nice to just load it and use it.

-MG.

Lightwolf
11-05-2004, 09:45 AM
Hi MG,
theo is overlaying the image onto the red base colour of his cup.

You want a complete decal on a base surface that has different properties, so you need to split up the alpha to mask out surface properties ... like transparency.

Cheers,
Mike

chrisdz
11-05-2004, 09:51 AM
Theo, when I do exactly what you've done (which is how I started) using a photoshop CS document with transparency (and an alpha channel saved - either way the result was the same), I ended up with a white box behind my decal image.

The whole reason I was confused by this was that I'm pretty sure I knew exactly what I needed to do, and it simply didn't cooperate. I figured a PSD with transparency alpha would just *do* what I needed with no wrangling as long as I set the parameters properly.

I've found a basic way around the problem, but I still end up needing to put that transparency alpha channel in every shader channel I use or it will do things like pick up specularity, etc.

This is the image I was working on. These are just photoshop layers "decaled" on flat square polygons.

mgrusin
11-05-2004, 09:57 AM
Wolf -

Just tried it, and you're absolutely right! I've spent the last few days making "cut out" objects (requiring the transparency channel) and confused myself; just tried a decal (showing the base color) using Theo's "easy" method, and it works just fine here, even with ancient Photoshop.

Thanks for the correction. Where's that coffee? :p

-MG.

Lightwolf
11-05-2004, 10:04 AM
Thanks for the correction. Where's that coffee? :p

You're welcome. I can't help you this time though, I just ran out of coffee ;)

Cheers,
Mike

theo
11-05-2004, 02:39 PM
Ooohhh......Chris I gotcha- Yes- you will have to jump through a couple of more hoops to pull that type of transparency off. I am glad to see that you worked through it though. I just did not understand exactly what you were trying to accomplish when the thread first started- now I do.

Great design by the way.

Looks like you've got your end worked out too mgrusin.

Later guys-

Chuckpie
10-23-2006, 05:44 PM
You guys appear to know just what to do. But, for us total newbies I was woundering if there was a tutorial for appling a decal to just part of an object? Say a small decal to the middle of a square object. I mean from step one. Thanks, Chuck:help: :help:

csgoss
11-02-2006, 02:16 PM
I have been having similar problems with alpha channels.
I set them up with the image map in the colour channel and the alpha inverted in the transparency channel.
I was getting a feint white box around the image map where the alpha channel should be rendering transparent.

After reading this thread it has been most helpful. It was the specularity setting that was on 5% that was showing up as white in the alpha channel.
I set it to 0% and that sorted it.

Thanks!!!

Tried some of the techniques mentioned above, such as an embedded alpha tiff (alpha layer on) and layering the alpha channel in the colour channel, for what ever reason it did not work for me?
But I will try the alpha embedded psd file when or if I get time...

I am at a loss as to why there is so many ways to set up alpha channel cut outs, the other 3d programs I work with seem to have kept things far more simple - one setting for the alpha channel job done!

THREEL
11-02-2006, 10:22 PM
I must be missing something here in this thread because decaling is easy as pie- so forgive me if I seem dense as I post this image to explain just how easy decaling is-

I've been wanting to figure this out for a long time. I always tried to match the logo background color to the color of the surrounding surface, but could never get an exact match, even if I match the RGB #'s.

I used Corel P-Paint and made an Alpha Channel there. The only thing is I had to use Difference under Blending Mode to get the desired look. It didn't come in for me right under the Normal Blending Mode.

Thanx Theo!

tHREEL, but you can call me AL.