PDA

View Full Version : node transparancy problem with xfrog tree.



vonpietro
09-13-2014, 11:07 PM
I'm playing with an xfrog tree, instanced and was trying to vary the colors using the material switch.

however, when i tried to put the transparent white leaf into the transparency input, it just gave me black solid poly instead of the nice leaf with alpha.

it works on the panel, just not in the node.

when i invert the image like on the panel, i get a nice leaf in the middle of the poly, switch on invert and it just turns into a black polygon. (in panel invert makes the edges dissolve away like it should)

also anyone know which node item i'm supposed to be using image node,
on the image node - color , alpha, or luma - which one is the one one that gets plugged into the transparency.
also - i tried all of them and none worked.

any ideas?
thanks

heres the node.124244 did i set that up wrong?

spherical
09-13-2014, 11:24 PM
Actually, it looks as if it's not working in the panel. If it were, I would expect the black part of the sphere to be gone. I would think that Alpha should go into Transparency. Haven't had time to mess with my XFrog trees, so don't know from experience.

vonpietro
09-13-2014, 11:54 PM
i turned it off in the panel - was trying to do the transparency in the node only.

it'll work in the panel with the default settings that xfrog gave,

its when i tried to duplicate it in the node so that i could get variance in the material using instancing that i couldn't get it to work.

even a simple set up irregardless of the instancing switch stuff, i may have set it up wrong. not sure

image node - white alpha image into transparency, should work right?

CaptainMarlowe
09-14-2014, 12:14 AM
If you want to use transparency with an xFrog plant in the node editor, you may want not to use an instance of the original leaf with "alpha only", like in the panel editor, but instead load the leaf_a.tiff (or something like that) that should be provided with your frog plant. There, the leaf should be black on a white background.
Just plug this image color in the transparency channel. It should work.
Also, if you have some trouble around the leaves when rendering (e.g. a thin white or black line around the leaves borders), I have found out that changing the mipmap of the transparency image to "off" could help considerably.

124245

vonpietro
09-14-2014, 02:25 AM
THANKS i guessed about the minmap - i turned it off.

i changed the tiff into a png and then a jpg, and that solved whatever was going on with just getting a simple setup to work with the transparency. It didn't like the tiff in the node panel for some reason, weird.

however it didn't solve the instancing problem with the switch material.
i'm using the same technique as used in the siggraph car example to change instances randomly using the switch material node.

plug several variations of material into the switch and the instance id, and you get random colors, ideal for the tree too i thought.

so i tried creating a material using image node and then color layered node, but when i plug it into the transparency - it's that solid black, and the transparency is failing.
heres a new screen shot.
124246

you can see the two other trees are variations of the other materials, i just used color for those two in the image so the random coloring is working.

the next step was to try to get the textures working. thats when the transparency fails.

CaptainMarlowe
09-14-2014, 03:26 AM
I don't understand what do you try to achieve. You want to have color variations on the instanced trees ?
If so, I think your setting is quite far fetched. A simple color gradient between your base image and the leaf color input would be enough.
Then, with instance info, you can choose between ID or fixed random as an input.
ID will get you more control, but you'll have to have a max value equal to the instance number in the gradient editor, and can be more difficult to tweak if you have a very large number of instances.
Fixed random is more straightforward, but you have less control on specific instances color.
124247 124248

Thomas Leitner
09-14-2014, 07:43 AM
....when i invert the image like on the panel, i get a nice leaf in the middle of the poly, switch on invert and it just turns into a black polygon. (in panel invert makes the edges dissolve away like it should)....

hi.
I made a quick test and it seems that invert in the image node is broken. This also applies to color: use a image as color map and invert it, it becomes black.
Tested in LW 1.5 and 11.6.2.

ciao
Thomas

p.s.: as a workaround for now: invert you image in a photo editing software...

vonpietro
09-14-2014, 10:31 AM
hey captain,
i just wanted to thank you, your solution works great, and is exactly what i wanted to do.
thanks for the assist, i really appreciate that.

i'm new to nodes.

I was using the technique outlined here at about 15 mintues
https://www.youtube.com/watch?v=ihnY__SKtR8

I'm glad you showed me that i dont have to use materials to get that result.
also i did not know what you could plug into that input in the gradient(input channel), so that helped me understand that node better. thanks

thanks thomas.

CaptainMarlowe
09-14-2014, 01:41 PM
Glad it helped.

Slartibartfast
09-14-2014, 01:47 PM
hi.
I made a quick test and it seems that invert in the image node is broken. This also applies to color: use a image as color map and invert it, it becomes black.
Tested in LW 1.5 and 11.6.2.

ciao
Thomas

p.s.: as a workaround for now: invert you image in a photo editing software...

From what I remember, those leafs have an embedded alpha channel which gets inverted also. No broken invert-button, but if you have a black leaf on white background, and the alpha is inverted you get just black...
As said, make it a separate color image and a separate alpha for better control.

spherical
09-14-2014, 03:46 PM
From what I remember, those leafs have an embedded alpha channel which gets inverted also. No broken invert-button, but if you have a black leaf on white background, and the alpha is inverted you get just black...
As said, make it a separate color image and a separate alpha for better control.

Really? We bought the whole collection and getting them is a pain in the buns, the way they have it set up. Now, in order to use them in a more standard way the maps have to be massaged?

gerry_g
09-14-2014, 03:53 PM
not sure what above technique is supposed to do but I would earnestly suggest you take the transparency away from being a nodal function and do it with a clip map through the object properties render tab and use your stand alone alpha here, it should render a lot more cleanly without any specular or reflection problems and if you're using radiosity much faster

Thomas Leitner
09-15-2014, 12:32 AM
From what I remember, those leafs have an embedded alpha channel which gets inverted also. No broken invert-button, but if you have a black leaf on white background, and the alpha is inverted you get just black...
As said, make it a separate color image and a separate alpha for better control.

What I mean is not a issue with x-frog images, it's a general bug. Try the sample scene. It uses a simple jpg image (of course without alpha) to control the transparency via nodes. Use invert gives you a plane without transparency at all. You can plug the image node into the color input and you get strange results too.

124272

Test scene:
124273

ciao
Thomas

Slartibartfast
09-15-2014, 10:09 AM
I'll have a look when I get home tomorrow to see if I can confirm.
Probiner: it was a long time since I used those leafs and I might be wrong, but if I ain't then a simpler solution MIGHT be to go to image editor and turn off alpha.
Cheers

Slartibartfast
09-16-2014, 12:50 PM
Ok. After some tests I came to the conclusion that the INVERT-button in the node editor image inverts the image AND the embedded alpha channel. In case of no embedded alpha channel it just assumes it's alpha must be 100% and inverts it to 0%!!! So from the computers perspective, it's not broken, but from an artist's view it's kinda not what you expect i guess...

Thomas Leitner
09-16-2014, 02:31 PM
Ok. After some tests I came to the conclusion that the INVERT-button in the node editor image inverts the image AND the embedded alpha channel. In case of no embedded alpha channel it just assumes it's alpha must be 100% and inverts it to 0%!!! So from the computers perspective, it's not broken, but from an artist's view it's kinda not what you expect i guess...

I think it's a little more complicated: the only thing that works as expected, is a embedded alpha channel. If you choose "Invert" the embedded alpha inverts (connect alpha output of the "Image" node to "Transparency" and choose "Invert").
BUT: the color information of the image will not inverted, but LW switches to the background color. To test this change the background color in the "Image" node to a eye-catching color and choose "Invert".

This behavior was confirmed by the technical support in the meantime (fogbugz: Case 72572):

"This is a misunderstanding of "invert" in the node editor.

That "inverts" the background/foreground of the node. It turns black, because the BG color of the node is black. Change that color, or plugin another node, and you'll see.

What you are trying to do in the node editor you do with other nodes 'after the fact'- for example, putting in an 'invert' node between the luma output of the image and the transparency input on the surface.

This isn't a bug."


They say it should do so. I have no idea why you need this. It's completely useless. It works differently than in the Texture Editor and we are missing its usability.

But we could be happy because it's no bug.

ciao
Thomas

Thomas Leitner
09-17-2014, 02:23 AM
I think it's a little more complicated: the only thing that works as expected, is a embedded alpha channel. If you choose "Invert" the embedded alpha inverts (connect alpha output of the "Image" node to "Transparency" and choose "Invert")....

To illustrate the whole:
If you use a image with embedded alpha to control the transparency "Invert" works correct. You can see it in the attached image.

124323

Unfortunately, it does not work for the color channels and LW switches to the background color.

ciao
Thomas

Slartibartfast
09-17-2014, 09:55 AM
You are absolutely right Thomas! I noticed the same thing and even if it's not the same name on the button on the old texture panel (invert layer vs invert) it's really a strange way to invert an image. Can't see any use for that (bug free) functionality.

Sensei
10-24-2014, 01:36 AM
To illustrate the whole:
If you use a image with embedded alpha to control the transparency "Invert" works correct. You can see it in the attached image.

124323

Unfortunately, it does not work for the color channels and LW switches to the background color.


So it's working as intended to. And this was always this way. Who said Invert in 2D Textures > Image node will negate RGB image?

See LW v9.6:

125195

125196

It's "Invert Sources", not "Invert-Negate image".

Sensei
10-24-2014, 01:49 AM
p.s.: as a workaround for now: invert you image in a photo editing software...

Nope.
Open Image Editor, make clone of image (or not), and click Invert in Editing tab..

Thomas Leitner
10-24-2014, 06:08 AM
So it's working as intended to. And this was always this way. Who said Invert in 2D Textures > Image node will negate RGB image?

See LW v9.6:

125195

125196

It's "Invert Sources", not "Invert-Negate image".

Did you read the whole thread?
1. Invert Sources would be useless (= switch to BG color...why?). Particularly because blend does not work anymore.
2. If you use a image with embedded alpha to control the transparency "Invert" works correct. The Transperency inverts too and in this case it does not invert the background/foreground. By your logic, that would be a bug.

It should work like the "Invert Layer" button in the Texture Editor.

ciao
Thomas

Sensei
10-24-2014, 06:35 AM
Did you read the whole thread?

Did you bother reading what authors of LW application wrote to you in bug report?

You don't understand how feature is working and claiming that it's buggy because you don't understand it..



1. Invert Sources would be useless (= switch to BG color...why?). Particularly because blend does not work anymore.
2. If you use a image with embedded alpha to control the transparency "Invert" works correct. The Transperency inverts too and in this case it does not invert the background/foreground. By your logic, that would be a bug.


Not inverted:
http://forums.newtek.com/attachment.php?attachmentid=125205&d=1414153624

Inverted:
http://forums.newtek.com/attachment.php?attachmentid=125203&d=1414153624

Not inverted with alpha:
http://forums.newtek.com/attachment.php?attachmentid=125204&d=1414153624

Inverted with alpha:
http://forums.newtek.com/attachment.php?attachmentid=125202&d=1414153624

Inverted with alpha with opacity:
http://forums.newtek.com/attachment.php?attachmentid=125206&d=1414153979



It should work like the "Invert Layer" button in the Texture Editor.


No. It should work, as authors of application wanted to.

And it's working as expected.

It has *NOTHING* to do with negative of image. Since ever.

Thomas Leitner
10-24-2014, 08:29 AM
Did you bother reading what authors of LW application wrote to you in bug report?

You don't understand how feature is working and claiming that it's buggy because you don't understand it..



I have read what the technical support replied: the feature is: .....That "inverts" the background/foreground of the node....
And yes, as I have already mentioned, I don't understand the usefulness of it: Everything that you show in your node tree can be done without invert FG/BG.

Since you already know my bug report try the Alpha Inverttest scene. As you can see in the images the "Invert" button does not invert FG/BG (embetted alpha and BG color). It's inverts the alpha channel. A bug?

And try this: use a image without alpha. Connect it to surface color. Invert FG and BG. Try to blend the switched colors. It does not work. A bug?


....No. It should work, as authors of application wanted to....

Of course, it works as authors of application wanted to. But that does not mean that it should be so. Everybody can hope for better features.
The former authors of this application have incorporated a similar named feature in the Texture Editor. Maybe the current authors of this application should look at this....



....And it's working as expected....

Maybe for you...



....It has *NOTHING* to do with negative of image. Since ever.

Yes, unfortunately.


ciao
Thomas

Sensei
10-24-2014, 08:52 AM
And yes, as I have already mentioned, I don't understand the usefulness of it: Everything that you show in your node tree can be done without invert FG/BG.

Everything in this world can be made dozen different ways...

But repeat in your Layout what I showed on above pictures, maybe you will find usefulness when you'll see it on your own eyes.
And you will see it will be HARD to replicate it.
You would have to have 2x Image nodes with 2 images picked, Tools > Mixer, and 3rd Image node with Alpha exposed and plugged to Opacity in Mixer.

With this functionality, we can stack couple Image nodes together one to another in series..


Yes, unfortunately.

I have never in life need for inverting image to its negative. To have f.e. blue (0,0,1) from yellow (1,1,0) input..
That's what would do "your" invert-negate with colorful image.
Even though I wrote node for doing so,
see TrueArt's Node Library > Math > Color > Invert..
Just in case somebody would have such need.

Inverting b&w is much more useful (for alphas).

Thomas Leitner
10-24-2014, 10:38 AM
....
I have never in life need for inverting image to its negative. To have f.e. blue (0,0,1) from yellow (1,1,0) input..
That's what would do "your" invert-negate with colorful image.
Even though I wrote node for doing so,
see TrueArt's Node Library > Math > Color > Invert..
Just in case somebody would have such need.

Inverting b&w is much more useful (for alphas).

Yes, indeed, b&w is much more useful but you can't with the Image node. And I have never need for inverting color image to its negative, too.



Everything in this world can be made dozen different ways...

But repeat in your Layout what I showed on above pictures, maybe you will find usefulness when you'll see it on your own eyes.
And you will see it will be HARD to replicate it.
You would have to have 2x Image nodes with 2 images picked, Tools > Mixer, and 3rd Image node with Alpha exposed and plugged to Opacity in Mixer.

With this functionality, we can stack couple Image nodes together one to another in series....

Yes, for this example you would need a Mixer additionally, but you can use the embedded alpha to set the opacity.
But: I never said that the possibility to stack several Image node together is useless. The Invert button makes not much sense (you can invert FG/BG by assembling your nodes different).

And: "Invert" don't work correct (or maybe the authors of this application want it so?).
Here 2 images are mixed together with Mixer node with "Subtractive" mode :

125207

Here 2 images are mixed together directly (with inverted FG/BG) with "Subtractive" mode:

125208

ciao
Thomas

THIBAULT
12-06-2014, 11:53 AM
If you want to use transparency with an xFrog plant in the node editor, you may want not to use an instance of the original leaf with "alpha only", like in the panel editor, but instead load the leaf_a.tiff (or something like that) that should be provided with your frog plant. There, the leaf should be black on a white background.
Just plug this image color in the transparency channel. It should work.
Also, if you have some trouble around the leaves when rendering (e.g. a thin white or black line around the leaves borders), I have found out that changing the mipmap of the transparency image to "off" could help considerably.

124245

And if i want adding Specular ? Thanks in advance

Sensei
12-06-2014, 12:13 PM
And if i want adding Specular ? Thanks in advance

You can take Shaders > Specular > Phong
and use it as 1st param to Math > Vector > Add
or to Tools > Mixer.
2nd param, whatever you want color f.e. output from Shaders > Diffuse > Lambert..

THIBAULT
12-06-2014, 12:21 PM
Thanks Sensei but if i do that, specular is applying on transparence too !

Sensei
12-06-2014, 12:31 PM
Thanks Sensei but if i do that, specular is applying on transparence too !

But that's in normal surfacing too.
You can have material with 100% specularity and 100% transparent. Specularity is visible.

Show node tree screen-shot and/or attach scene for play.

If you will use Phong node and plug it to Diffuse Shading color, and adjust Transparency, specularity will disappear on transparent area.

Transparency 100% cancels what is plugged to Diffuse Shading. Not interfering with Specular Shading and Reflection Shading.

THIBAULT
12-06-2014, 12:54 PM
Thanks,
Attached files !

Sensei
12-06-2014, 01:28 PM
I am confused, as it has no node tree at all, just regular texturing. No specularity..

I have fixed look that we have by clicking Double Sided, and turning off Invert.

After loading scene:
http://forums.newtek.com/attachment.php?attachmentid=125889&d=1417897558

After my changes:
http://forums.newtek.com/attachment.php?attachmentid=125888&d=1417897558

THIBAULT
12-06-2014, 02:41 PM
Sorry and thanks, it's first essai version.
Attached new node work fine but darker.

Adding Multiply after Phong, and now, it's OK

Sensei
12-06-2014, 03:28 PM
No, don't do that. You just made Diffuse=Specularity entirely.

Phong to Math > Vector > Add (or Mixer) 1st param
Lambert to 2nd param
output from Vector to Diffuse Shading.

Specularity should be just addition to diffuse Lambert shader.
http://forums.newtek.com/attachment.php?attachmentid=125893&d=1417905265

THIBAULT
12-07-2014, 02:35 AM
Ok, it really is better! Thank you for the time spent, it's nice

Sensei
12-07-2014, 06:55 AM
Leafs should be partially transparent, so transfer light especially when we're looking from their second side.
Remember to use high Recursion Limit. I set 64.

http://forums.newtek.com/attachment.php?attachmentid=125914&d=1417959793

http://forums.newtek.com/attachment.php?attachmentid=125915&d=1417959793

http://forums.newtek.com/attachment.php?attachmentid=125916&d=1417960177

THIBAULT
12-07-2014, 07:19 AM
Thank you very much.
I begin with nodes.
Partially transparent, ie transluence?
Can you show me the last window nodes fulle please?
Thank you in advance

Sensei
12-07-2014, 07:23 AM
Thank you very much.
I begin with nodes.
Partially transparent, ie transluence?

No. Translucency in 3d is byproduct of calculation of Diffuse (cheap cheat). While transparency is ray-traced effect.

If I would turn on backdrop sky f.e., while using transparent leafs I should see sky color through them. While using 3d translucency, it won't work this way.



Can you show me the last window nodes fulle please?
Thank you in advance

What is hidden is in post #33 screen-shot.

Sensei
12-07-2014, 07:35 AM
http://forums.newtek.com/attachment.php?attachmentid=125920&d=1417962831

I added occlusion node to Lambert's Diffuse input.
And rendered with many AA passes at Full HD.

THIBAULT
12-07-2014, 07:35 AM
OK ! Many thanks !