when i render with something else than isotropic, i either render black(phong,henyey-greenstein,schlick) or i get no control over the shape of the spec (kajiya-kai,marschner). Am i missing something ? do i need to add some attributes on my particles to use the normal ?
thanks
The Phong Surface shading mode requires a valid Normal channel to perform meaningful calculations.
The Normal channel of Krakatoa is populated differently depending on the particle source.
Some history - when we added Phong Surface shading to Krakatoa MX, we needed a Normal (it is also used for reflection maps which are not supported in KMY yet). 3ds Max Particle Flow particles do not provide an explicit Normal channel, but they have an Orientation channel (which is a Quaternion) that could be used to extract the orientation of the X,Y and Z axes, and a Transform channel that contains the combined Orientation, Scale and Position channels. When using the “Align To Velocity” option in PFlow, we noticed that it assumed the X axis to be the one to align. So we made Krakatoa use the X axis of the transform as the Normal. Later on, when we needed a Tangent channel for hair shading, we assumed the Y axis to be the Tangent. We also ship a dedicated Particle Flow operator with Krakatoa MX to quickly steal surface data from meshes, including the surface normals, and apply to particles.
All these assumptions are thus very 3ds Max-centric.
The PRT Volume object in both Krakatoa MX and Krakatoa MY assigns a Normal channel value automatically. So rendering a PRT Volume in Max or Maya always produces correct Phong shading. It does not populate the Tangent channel though.
Obviously, if you are loading a PRT file that contains a valid Normal or Tangent channel written from Krakatoa MX or another source, Krakatoa MY will render it correctly.
When it comes to native Maya particles, Krakatoa MY does not make an assumption about the orientation of the particles at this point, but it looks at the “normalDir” attribute, or, if defined, the “normalDirPP” per-particle attribute. If set, it is copied to the Normal channel of Krakatoa. So for now, you have to make sure that attribute is set correspondingly to produce correct Phong shading. To my best knowledge, there is no way to set the Tangent channel, but Kajiya-Kay and Marschner should not be used for now until we get Hair and Curves support from Maya into Krakatoa MY. The shaders are there because they are part of the Krakatoa renderer, but they make no sense for shading non-hair stuff.
I am not sure why Schlick and H-G would render black for you, since all they need is the Phase parameter. They only depend on the camera and light directions and should not use Normals or Tangents.
Please note that we have every intention to port our Magma channel editing subsystem to Maya ASAP, so you will be able to set Krakatoa-related channels based on other values, or steal data from scene geometry in the future.
Schlick and H-G only render black if the excentricity is set to something else than 0.
i just rendered some nParticles emitted from a sphere emitter, i added a normalDirPP vector attribute that i set to “normalDirPP = unit(acceleration);” (i also tried with a constant value <<1,0,0>>) but it still render black.
any clue for me to use phong render or it can’t be used for now with particles created within maya ?
thank you
Perhaps there is a problem with the way we are getting the normals. I’ll see if I can track down the issue.
I am able to get normal information on my test scene here. Do you have a simple maya scene (nParticles with normals) that can reproduce the issue you’re seeing? If you could attach one, I’d like to take a look at it.
here is the scene i use to debug
thanks for being so quick
of course it didn’t work with .ma ! that should be ok i hope
normal_krakatoa.rar (8.61 KB)
Thanks, I’ll take a look at this soon.
here is a pic of what im trying to achieve. i want to get a more physical aspect to the particles and hope to achieve it with the specular.
krakatoa is incredibly fast thanks for that tool
I don’t think you need Phong shading to achieve that look. Just the right density balancing to get some particles lit and some in shadow…
no sorry that’s where i am but the ability to get some spec on it would improve the realism. I still didn’t manage to get that phong mode working.
Ah, cool, looks very nice already
did u manage to make that phong mode working ? do u have to set a normal attribute ? let me know please
thanks for your time
I took an initial look at the scene you posted last week. What I found was that Krakatoa was unable to find any normal information in the particles. We are looking for the “normalDirPP” channel in the nParticle system to get normals. So, the next step I was going to do was look a little deeper in the code to see if there either is a different way of extracting normals that I have missed, or if there may be some way to generate meaningful normals some other way.
Where would the particle normals be generated from in this scene that you posted? Perhaps I’m missing something.
i created an attribute called normalDirPP on the nParticle system and i set it to the normalized acceleration with a per-particle expression. The render is all black, like it can’t find the normal so the spec is 0 but also the color is 0
I forgot to mention in the last post, even though I wasn’t getting normals, it should still have some color. So there appears to be a bug in Krakatoa’s Phong mode that I’m trying to work out. Thanks again for posting this out!
did u manage to work out what is going on ? maybe you fixed the bug ?
cheers
Yes actually, we just fixed the bug. It will be in the next build. If you need a fix for this right away, I can send you the build as it is currently.
One note though: The scene you sent me has a normalDirPP channel, however, all the particles have a [0,0,0] normal value, which will still draw black using Phong. However, the bug was that it was not finding the normal channel, and that is fixed now.
wonderfull, i’ll wait for the next build thank you, i’ll let you know how it goes
This bug should be fixed in the build that was just posted. Thanks again for pointing out the problem!
I’ve been struggling with getting Phong to work as well. Is there something I need to do to get Normals to krakatoa? Sort of a noob here, so sorry if this is a basic thing.