Author Topic: All-or-Nothing Opacity  (Read 606 times)

Offline Eric Johannsen

  • Member
  • *
  • Posts: 18
All-or-Nothing Opacity
« on: December 27, 2016, 03:21:22 AM »
I have a model that renders fine in Blender. I exported it to an .obj + .mtl and imported it into TG4. The .mtl didn't include map statements to reference the texture and opacity maps, so I tried to add those into the imported .obj file's internal node.

Most everything looks great, except for a glass sphere at either end of the model. It renders entirely white.


If I click Invert Opacity Image, the glass is entirely clear (absent from the render).





The image used for opacity has an alpha of 128 and RGB 254,254,254.
How can I get the glass to render, well, like glass?

Offline Kadri

  • Member
  • *
  • Posts: 7834
Re: All-or-Nothing Opacity
« Reply #1 on: December 27, 2016, 03:27:53 AM »

Try the "Glass" shader (right click+create shader+surface shader).

Offline Eric Johannsen

  • Member
  • *
  • Posts: 18
Re: All-or-Nothing Opacity
« Reply #2 on: December 27, 2016, 03:52:56 AM »
The transparent shader was created by the OBJ importer and is part of the internal node of the OBJ's Parts Shader. I'm not sure how I would go about replacing the transparent shader from the internal node with a glass shader.

Offline Kadri

  • Member
  • *
  • Posts: 7834
Re: All-or-Nothing Opacity
« Reply #3 on: December 27, 2016, 05:48:27 AM »

If you know how to handle nodes Eric just change the old one with the new one.
Or you can put it below the old one.


Offline Dune

  • Member
  • *
  • Posts: 12625
  • Corkscrew Bird
    • www.ulco-art.nl
Re: All-or-Nothing Opacity
« Reply #4 on: December 27, 2016, 08:50:28 AM »
Don't forget that your object has shadows turned on, so the glass will also have shadows and thus will be pretty dark. Best is to separate glass parts of the object as separate objects, in which you can turn shadows off.
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline Eric Johannsen

  • Member
  • *
  • Posts: 18
Re: All-or-Nothing Opacity
« Reply #5 on: December 27, 2016, 06:01:46 PM »

If you know how to handle nodes Eric just change the old one with the new one.


The OBJ importer created a Parts node, the internal node of which has one node per material in the OBJ that isn't connected to anything else in the object graph.



How exactly do I replace the automatically created "transparent shader" that is not connected to anything else?

Offline Kadri

  • Member
  • *
  • Posts: 7834
Re: All-or-Nothing Opacity
« Reply #6 on: December 27, 2016, 10:14:45 PM »

If you mean the white "Transparant" node it doesn't have to be connected anywhere.
Just try the same as i wrote above.
I changed that example according yours below.


Offline Eric Johannsen

  • Member
  • *
  • Posts: 18
Re: All-or-Nothing Opacity
« Reply #7 on: December 28, 2016, 12:17:24 AM »
Thanks, it's working now.

I do see dark shadows. Looking into splitting the OBJ into two.

 

anything