Dark edge on texture with gradient alpha

   5849   5   3
User Avatar
Member
61 posts
Joined: Feb. 2011
Offline
I have a grid with .png file texture, which gets copied to some points.
The image has a radial gradient with mainly bright white/blue colors in the middle and transfers to an alpha of 0 to the outside.
My intention is to have it look like bright spots where the electricity makes contact with the sphere.

When rendering, the area where the alpha is between 0 and 1, the colors seem to darken.
Also, actually, the texture itself seems to be quite dark.
But I think that's because of self-shadowing, which I'd like to turn off, but I can't seem to find where…

Could anybody clarify why that darkening is happening?
(And perhaps give a tip on where/how I can turn off the self-shadowing?)

Thanks
Eckxter

Attachments:
ZERO_test.0029.jpg (57.7 KB)
tx_ContactLight.png (29.1 KB)
TextureFX_ZERO_002.hipnc (751.5 KB)

- A little nonsense now and then, is relished by the wisest men.
User Avatar
Member
61 posts
Joined: Feb. 2011
Offline
I figured it out.
Instead of doing it in SOPs, I set up a little shader and apparently I needed to plug my alpha channel in the opacity input of the shader.

That just leaves me with figuring out what the big difference is between alpha and opacity.


Eckxter

Attachments:
ZERO_test.0002.jpg (56.9 KB)

- A little nonsense now and then, is relished by the wisest men.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Af = avg(Of);

or if you don't wire anything in to Af on the Output ROP in your material, the average value of Opacity wired in to Of is used to compute alpha.

For raytracing and pbr, you need to be a bit careful with Of as it truly is transparency and rays will go straight through your geometry without refraction if set below 1.0. In your case this is what you want I believe. If you use refraction, you set Of to 1 and rely on the refract bsdf to compute the refraction rays.

Wiring a value in to Af will pass that value directly in to the alpha channel of the rendered image. This would be a direct channel export to the alpha channel.

Hope that helps.
There's at least one school like the old school!
User Avatar
Member
61 posts
Joined: Feb. 2011
Offline
Cool, thanks for the info jeff.
You are correct.
The effect I'm trying to achieve doesn't require refraction at the moment.
So just using the Of is enough for now.

It did, however, make me think that refraction could add to the effect by having the orb shader distort everything else.
To give the sense of some energy that's distorting the light.
Sadly enough, I don't fully understand the relation between Of and Af, which you talk of.
I'm still pretty new in the field of creating shaders/materials as in-depth as Houdini allows you to.
I understand that Of is what says whether a light ray goes straight through or not.
But then what is Af for? If it's basically the average of Of and just a float value, what would you use it for instead of Of?
Whenever I wire something into Af, nothing really changes.
Or if something does change, I don't quite understand what's happening.
And probably because of this, I'm not following what you're saying about wiring something in Af
which would be a direct channel export to the alpha channel.

Feel free to point me to a (Houdini relevant) paper (if possible) about this stuff that I can read or a tutorial or something like that.

Thanks for the help!
Eckxter
- A little nonsense now and then, is relished by the wisest men.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Af is what is written to the alpha channel of your image. That's it. It's just a plain channel export for you to use in compositing. I believe no part of Mantra uses Af directly.

Be reminded that all default Mantra shaders shipped with Houdini premultiply the colour by the alpha (pre-multiplied alpha). This makes compositing consistent. Nuke and our own compositor has an Un-Premultiply node in case you wish to go that route.

Also remember that Af = avg(Of) so that setting Of will set Af which is used to pre-multiply the colour prior to outputting to Cf. F (BSDF) is also pre-multiplied by the alpha.

Setting Of in your case is the way forward.


Of is used to set the transparency of rendered geometry. If 0<Of<1 (between 0 and 1) then mantra will have to deal with transparency. If you have many layers of geometry as with particle sprites or volumes, this may take a long time as each opacity sample needs to be shaded.

We added Stochastic Transparency sampling and the partitioning of shaders in H12 I believe. If you have Stochastic Transparency enabled on the Mantra Output ROP, mantra will first evaluate the opacity using Of in the shader (compiles the shader for Of only). Then once the opacity samples are computed, will shade the geometry.

This decouples the Opacity sampling from the shading. Good for rendering volumes more efficiently.


Complicating things further, if you are using Refraction, you need to set opacity to 1. If you don't, you will get both contribution from refracted rays and contribution from directly transmitted rays.
There's at least one school like the old school!
User Avatar
Member
61 posts
Joined: Feb. 2011
Offline
Nice! This is some sweet info.
Cleared up a lot for me.

Thanks jeff!
- A little nonsense now and then, is relished by the wisest men.
  • Quick Links