Alpha textures and shiny/bumpy?
|
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
|
08-02-2008 08:08
Bit of a noob here, so please be gentle ...
If I create a texture with alpha in Photoshop and export to PNG and upload it, I find that setting "Shininess" and "Bumpiness" has no visible effect. Is this because of the alpha channel? Is there any way to have a texture that (a) contains transparency and (b) is shiny or bumped or both?
Many thanks
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
08-02-2008 08:23
First things first .... If you are saving an image as a PNG file, you don't need an alpha channel. PNG's simple transparency scheme creates transparency wherever it sees no pixels in your image. If you like alpha channels -- I do, personally -- then save your file with its alpha channel in TGA format. (Yes, I know PNG also allows an alpha channel for complex images, but most people who use PNG choose it in order to avoid alpha.)
The presence or absence of transparency, no matter how you create it, should have no effect on your image's shininess or bumpiness.
|
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
|
08-02-2008 08:34
OK, so I'm already at the limit of my knowledge of alpha! It's something I need to understand more fundamentally, I think - I really should Google around for some basic tutorials on alpha and transparency. Maybe there isn't an alpha channel as such in the image - certainly, if I open the PNG in Photoshop 6 and look at the channels, I just see "RGB", "Red", "Green" and "Blue". The method I've used to create the texture has been to take an image (JPG or whatever), add a layer (with colour "none"  use that as a background, delete the portions of the actual image layer above where I need transparency, and doing "save as" to PNG and accepting the defaults. Is there a better method? And what on earth *could* be stopping SL from applying shiny/bumpy effects to my textures? This isn't the first time I've come across this, and since it always seemed to happen to textures which have alpha, I'd assumed it was connected.
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
08-02-2008 08:48
Barrington, it sounds like the answer to your second question is no, you haven't actually been creating alpha channels. You've been utilizing PNG's simple transparency. Had you actually been making alpha channels, you would have been using the Channels palette to do it, and you wouldn't have been deleting stuff.
There's oodles of material on this forum already about how to make alpha channels, so I won't repeat that information here. What I will say on the subject is I'd encourage you to learn to use them, so you can stop hitting that Delete key. It's always best to work non-destructively.
As for your first question, SL will not display shine and/or bump on any textures that have transparency in them. Presumably, this is to prevent the invisible areas from shining/bumping, since this would not be desirable in most cases. For every window that might look good with some shine on it, there are a thousand other images with transparent background that would look all kinds of wrong. In order to allow it effectively, we'd need additional texture channels for actual bump maps and shininess maps, which would greatly increase overhead. That stuff is coming, but it doesn't exist in SL yet.
In the here and now, if you want something to be bumpy and/or shiny, it has to be fully opaque.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
|
08-02-2008 16:18
From: Chosen Few In the here and now, if you want something to be bumpy and/or shiny, it has to be fully opaque. Ah - that's what I'd suspected, and for the reasons you give. Many thanks to both of you.
|
Robin Sojourner
Registered User
Join date: 16 Sep 2004
Posts: 1,080
|
08-04-2008 22:56
Although Chosen is correct, and using Transparency in the Build dialog disables Shiny and Bump, it is possible to have transparent shiny objects using a script.
(There are lots of things that can only be set with a script, and this is one of them.) The script is a fully modifiable freebie. IM me if you want a copy, and I'll drop one on you.
Hope this helps!
_____________________
Robin (Sojourner) Wood www.robinwood.com"Second Life ... is an Internet-based virtual world ... and a libertarian anarchy..." Wikipedia
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
08-05-2008 07:31
Robin, are you talking about shiny invisiprims, or have you found a way to make any arbitrary transparent texture shine?
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
|
08-05-2008 07:37
I've tried using a quick & dirty script to test this out, and it only works on textures I've tried that have no transparent elements. The test script is this: // face is 4 default { state_entry() { llSetPrimitiveParams([ PRIM_BUMP_SHINY, 4, PRIM_SHINY_HIGH, PRIM_BUMP_GRAVEL ]) ; } } Robin, I've sent you an IM. Thanks, all, for your help.
|
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
|
08-05-2008 10:28
single pass on any surface, shiny count for one and transparency for one, so you can't have both.
_____________________
 tired of XStreetSL? try those! apez http://tinyurl.com/yfm9d5b metalife http://tinyurl.com/yzm3yvw metaverse exchange http://tinyurl.com/yzh7j4a slapt http://tinyurl.com/yfqah9u
|
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
|
08-05-2008 11:45
From: Kyrah Abattoir single pass on any surface, shiny count for one and transparency for one, so you can't have both. If I understand you correctly, you're saying that there should be two calls to llSetPrimitiveParams(), one for shininess and one for *bumpiness* (not transparency, which is in the texture). In other words, you're suggesting something like this: llSetPrimitiveParams([ PRIM_BUMP_SHINY, 4, PRIM_SHINY_HIGH ]) ; llSetPrimitiveParams([ PRIM_BUMP_SHINY, 4, , PRIM_BUMP_GRAVEL ]) ; That goes against the syntax given in the LSL Wiki page on llSetPrimitiveParams(), which says that both need to be specified. In any case, putting that code in has no effect even on non-transparent textures, presumably because of that. The problem seems to be not in the way those attributes are set, which is easy, but in the way they're interpreted by SL. So you can do whatever whichever way with a solid texture in place, then swap the texture for one with transparency and the effects don't appear, even though they are still set. Set the texture back to solid, and it's shiny/bumpy again. Robin, I'd be very grateful for a copy of your script, so I can find out what's going on here.
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
08-05-2008 13:52
Barrington, I believe Kyrah was talking about render passes, not command sequences.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
|
08-05-2008 15:35
From: Chosen Few Robin, are you talking about shiny invisiprims, or have you found a way to make any arbitrary transparent texture shine? It looks like the script Robin send me uses an invisiprim texture. I tried the same script with another partially-transparent texture and it didn't work.
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
08-05-2008 15:38
That's what I figured. Thanks, Anya.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|