I´m trying to render some simple particles with random values for rgbPP, but in the render they always show up black. Overwriting the emission color works,
but I´d like to render my particles with the inidividual rgbPP values. As far as I know this should be possible?
The python scene file contains a comment “#Particle System contains rgbPP channel, disabling Shader RGB Override”, so rgbPP should be found …
but I don´t see it affecting the render. Am I missing something?
I´m using a directional light, particle render type and I´m running Win 7 64 bit.
Could you post the PY scene file so we can take a peek?
Sure, here is both the py-file and the exported prt-file. Thanks for looking into it!
test.zip (25.7 KB)
Ok, I looked at the scene and here is what I found.
*You haven’t really done anything wrong and the ppRGB data is in the PRT (checked it in Max both in the viewports and using the Particle Data Viewer spreadsheet).
*I disabled the UseEmissionColor (which is set to green) to get only the particle’s own color showing.
*The Direct Light export to Krakatoa is a bit screwy though, and I take full responsibility for that. The problem is that Maya assumes a Direct Light to be infinite number of parallel rays. Krakatoa though needs to define an area to generate the attenuation map for, so while the Direct Light is still parallel rays, it has a cylinder (similar to the cone of a Spotlight, but parallel) where illumination is calculated, and no illumination outside of that. In my attempt to emulate the way Max and Krakatoa operate in this case, I was exporting the Maya Direct Light with a large, but not infinite InnerRadius and OuterRadius of 1000.0 units. In your case, this means that all particles fall within a single texel of the Attenuation map, so the first particle that is hit during lighting calculations immediately shadows all other particles. The default shadow map size is 512x512, so you have one texel covering two units, but your cloud is about 1.8 units in size…
To fix this, I changed the InnerRadius and OuterRadius in the file to 1.0 and got the illumination working. I suggest using Point or Spotlight when possible, since that gives you a better idea where you light is and what it shines at.
NOTE that 3ds Max uses one unit as one inch by default, and according to documentation Maya is supposed to use one unit as one centimeter, but everybody seems to be assuming one unit to be something else (a meter?). So most models we export to Krakatoa have a size of hundreds of units, and most Maya users pass objects that are around one unit in total size. Since 3ds Max uses single-precision floats and Maya uses double precision, this is something we have to adapt to. That’s why we assumed such huge defaults for the InnerRadius and OuterRadius and indirectly caused this shadowing problem…
*The location of the Direct Light plays a role when working in Krakatoa, but it means nothing in Maya where only the orientation matters. I am not sure what the best solution would be for this case… Anyway, it was exported with world origin transforms and was casting shadows over half of the particle cloud. When I shifted the 4th row to 0,0,1,1 and got all particles showing their colors.
*The next problem was that the light was set to blue, so some of the colors were not very obvious, and I changed the “Flux” to (12.56636,12.56636,12.56636) which gave me white light.
So in short, the main issue here was the difference in interpretation of Direct Light between Maya and Krakatoa. I am not sure how Maya calculates shadows from Direct Lights, I would love to learn more about that if anyone has insights…
Enabling the Emission override added green to the particles, but the random ppRGB was still showing through somewhat.
Hope this helps.
Thanks a lot for the explanations. I know the centimeter-units in maya are really confusing … you have to take it as meters for example when working with nucleus or DMM. Maybe you should add a warning about directional lights to the plugin documentation …
Good point!
I think it is time to write the actual documentation…