PDA

View Full Version : Transparency and specularity quick question



TheWaste
07-29-2007, 12:39 PM
Hello again Gods of Lightwave :D

I've got another quick question. It's an easy one to simulate so you can all see what I mean quite easily.

In modeller (v9), make (for example) a sphere. Go to your surface editor and make the sphere (let's go all the way to extremes here) and choose 100% transparency. Give the surface approx 80% specularity and 5% glossiness.

If we bring this into Layout (v9) and render it, we can see the specularity of the sphere. However if we export this image as a PNG file and open it in photoshop, the image is completely blank. We can no longer see the specularity.

Something else I noticed, if we go back to the surface editor in Lightwave and change the objects transparency to 50% and re-render the object, save it as a PNG once again and open it in photoshop, we can now see the specularity and the object, but everything on the page is %50 transparent.

Is it possible to render this completely transparent sphere with visible specularity. I'm in some serious trouble if there's no way to do this... :thumbsdow

To make things more difficult, I can't simply (for example) make a black sphere with a black background, render the image, get the half specularity image, set it to a 'screen' blend mode and double the layer because the background needs to be true transparent.

Thanks for any help, Lightwave Gods ;)
Regards,
~TheWaste

munky
07-29-2007, 01:21 PM
Hi there,

just off the top of my head I'd have a look at the PSD exporter which might be able to do what you want!

Window/image processing add it under the "add image filter" drop down.

check the manual for how to use it.

hope this is of help

regards

Paul

TheWaste
07-30-2007, 06:29 AM
Hi Munky. Thanks for the suggestion.

Unfortunatly the PSD renderer has indeed outputted the specularity as a single layer, but doesn't include any transparancy... it outputs a black and white layer as a dodge channel...

Any other ideas guys? :(
Thank you very much for you help thus far Munky.

Captain Obvious
07-30-2007, 12:16 PM
Save as something else, other than PNG.

PixelFarmer
07-30-2007, 02:14 PM
Why does the BG need to be true transparent (vs. using some type of compositing to add the hilite)?

steve0077
07-30-2007, 02:25 PM
You can use the render buffer. I believe you can render different channels to buffer and save them.

toby
07-30-2007, 03:07 PM
The PNG format always pre-multiplies the rgb by the alpha channel. If your transparency is 100%, you'll have a black alpha, or 0. Multiplied by anything in the rgb and you get 0.

Use another format, and you may want to ignore the alpha and Screen the rgb over whatever you're compositing it with. Actually if you don't need the alpha then 24 bit PNG will work fine.

TheWaste
07-31-2007, 01:01 PM
Thanks for the reply captain. I have tried, but they all either come out as completely blank, or as a black and white image.

Thanks for the reply pixel. I will explain below...

Thanks for the reply steve. Render... buffer? Forgive me, I'm not terribly skilled at the technical aspects of Lightwave.

Hi toby. I understand what is happening, however I don't understand why. The specularity shine of the invisible globe should be 100% opaque, even though the globe is completely transparent. The desired output would be a completely white image with alpha only occuring on the specularity. I do indeed need the alpha, and I will explain why below.

To be honest, I can actually use a black and white image, however I will explain.

The image that I am making is going to be exported into Flash. Granted I can indeed apply a filter over the image (eg: screen or dodge), the result is a simple object that uses un-nessisary amounts of processing in a situation where processing is already looking to be dangerously high.

This is why I need the specularity of a near-transparent object to be visible against a alpha channel. This image isn't just going into Photoshop to be exported as a designed image... it is going into a Flash game.

Thanks again for all of your help. It is very much appriciated.
Regards,
~TheWaste

PS: If I need to resort to plan B here, how does one use photoshop to convert black pixels into transparent white pixels? If you use 'screen' or 'dodge' blending against a transparent backdrop, the result doesn't change the image at all (eg: it remains black and white).

However I do not want to resort to this... it will make my life *very difficult*... whatever I need to do, I need to repeat it around 50 times and manually add anything that isn't supposed to be transparent.

PixelFarmer
07-31-2007, 09:19 PM
Okay.
This is pretty unusual, not the perfect solution but I bet it will meet your needs:

In LW, open the Effects Panel (b), go to the processing tab.
In the Add Image Filter Section, add Buffer View. This step is for illustration purposes. Double click Buffer View and check "Specular Shading". This will allow you to render the separate layers of your image and view them in the Render Image Viewer. Do an F9 and in the image viewer, you can choose "Specular Shading" from the layer menu of the Image Viewer. Now you see what you are getting.
Now for the real thing. Go back to the Add Image Filter Section and add Buffer Export. Again set it to Specular Shading and choose file type, image name, etc. I don't think you get to specify a directory where the images are saved. In my quick test the images were saved to my Content Dir. Oh well. You don't need the alpha for this image, so you can choose a 24 bit format. I used 24 bit png.
Now to PhotoShop. You will need to process all the images, but are you familiar w/PShop Actions? You can setup a single Action to perform all these steps and then apply the action to a folder of images using File/Automate/Batch... Look it up.
For illustration purposes, follow these steps, but once you get the picture (no pun intended), you will not need to include all of these steps in your Action.
In PhotoShop, double click the BG layer to create a regular PShop Layer.
Create a new layer and fill it with a solid color and put under the layer w/the Hilite. This layer is for illustration purposes only. Note that once you see how this works, you could test this using in an image which will be receiving the Specular Hilight in Flash.
Now back to the Specular Hilite Layer. Select all, copy, create a new layer mask. Alt click the layer mask to make it the current layer and so you can see it. Paste. This will paste a Grayscale version of your Specular Hilight into the Layer Mask which means you've created an alpha channel using the luminance of the Specular Hilite. You will see that Specular Hilite is being comped onto the layer below it.
At this point you can use Image/Adjustments/Curves (or any PShop tools - Image/Adjustments/Levels would also be an appropriate choice) to adjust either the Specular Hilite in the main Layer or the Alpha Channel (Matte) in the Layer Mask or both. In my quick test, I used Curves separately on both parts of the layer to make the Hilite brighter.
W/mouse on the Layer Mask, RMB and choose "Apply Layer Mask". You now have the Hilite on a layer w/transparency.
"But what about the black fringing?" You ask. Easy.
With nothing selected, Layer/Matting/Remove Black Matte or Layer/Matting/Defringe (choose "1"). Magic.
Delete the BG. Save as png (f you render to png from LW, then all you have to do is save). Import into Flash.

toby
07-31-2007, 10:39 PM
Hi toby. I understand what is happening, however I don't understand why. The specularity shine of the invisible globe should be 100% opaque, even though the globe is completely transparent.
Not really, the alpha is primarily for geometry, not surface properties. That would cause problems. And yes, Screen only works when you have something for it to be Screened over.


The desired output would be a completely white image with alpha only occuring on the specularity.
You have it backwards, objects in the alpha are white, on a black background.

To get a black&white image to transparent&white;
Select all
Copy
Enter Quick Mask
Paste
Exit Quick Mask
New Layer
Fill w/White
Drink Lager (or as they say down there, Laaah-geh.)

TheWaste
08-01-2007, 04:28 AM
Hi Pixel and toby... thanks for your suggestions, especially pixel who went through the rigourous task of going through the process and writing it all out of yours truely.

Toby, your answer seems obvious to me now... the process didn't seem to fit together in my head at the time of writing though. However thanks for the refresher course.

At the moment, I really can't be bothered testing it all... and I still need to make some changes to the models before I publish anyways, but when the time comes I'll cerntainly be trying these methods out. Thanks guys.

Now if you'll all excuse me I'm going to follow the last part of toby's suggestion and drink some laaah-geh!

(PS: cultural tip: I've never *ever* met anyone in Australia who talks like that, and I've lived here all my life. Am I missing out on the best part of being Australian?)

toby
08-01-2007, 09:56 PM
Now if you'll all excuse me I'm going to follow the last part of toby's suggestion and drink some laaah-geh!
Hasn't failed me yet!

(PS: cultural tip: I've never *ever* met anyone in Australia who talks like that, and I've lived here all my life. Am I missing out on the best part of being Australian?)[/QUOTE]
Nah, that's just the way it sounds to us. The half of us that know what Lager is, would say it like "Lawgurrr" to your ears