Community
Maya Shading, Lighting and Rendering
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya materials topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

particle sprite Arnold

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
Anonymous
3399 Views, 14 Replies

particle sprite Arnold

So I've been trying to get a simple scene with particle sprites to render.

I have particles with different sprite numbers so they are attached to different png files.

This all works in the viewport, but when I render with arnold all the particles just pick the same file.

14 REPLIES 14
Message 2 of 15
jordan.giboney
in reply to: Anonymous

Hi @Anonymous 

 

Thanks for posting! Want shaders are you using to assign the pngs? You'll want to use aiStandard shaders for the most reliable outcome.

 

Also, have you checked out Solid Angle's documentation pages? Theyre loaded with good information on whats supported and not supported within rendering workflows: Particles - Arnold 5 User Guide

 

Thanks again for being a part of our community!

 



Jordan Giboney
Technical Solutions Engineer | Media & Entertainment
Installation & Licensing forums | Contact product support | Autodesk AREA


Message 3 of 15
Anonymous
in reply to: jordan.giboney

Hi Jordan,

thanks for the response.

 

I did try using the AiStandardSurface, but then it picks just one file even in the viewport.

When I use a lambert as the maya documentation suggests everything looks fine in the viewport, but in the arnold render it just does one file again. Besides that I noticed that the sprite twist doesn't work either with arnold.

The arnold documentation doesn't say anything about sprites.

Regards.

Message 4 of 15
mspeer
in reply to: Anonymous

Hi!

I can confirm this.

It's easy reproducible by using:

Effects -> Smoke

Message 5 of 15
Stephen.Blair
in reply to: Anonymous

If you could have string PP attributes, this would be trivial to do with the <attr> token. But unfortunately PP attributes must be float or vector.

 

You can still use spriteNumPP though, just not directly in the texture file name.

 

  • Define a creation expression to set spriteNumPP to some random number.
    For example: nParticleShape1.spriteNumPP = trunc( rand( 8 ) )
  • Add spriteNumPP in the Arnold > Export Attributes text box (Arnold section of the nParticle Attribute Editor)
  • In the shader tree, use UserDataFloat to get spriteNumPP
  • Plug that into an aiSwitch
  • Provide different textures for the different spriteNumPP values

That's ok if you have a small number of textures.



// Stephen Blair
// Arnold Renderer Support
Message 6 of 15
Anonymous
in reply to: mspeer

Hi mspeer,

thanks for the response.

Effects-->Smoke doesn't solve anything sadly.

Still arnold just picks one file.

Regards.

Message 7 of 15
Anonymous
in reply to: Stephen.Blair

Hi Stephen,

thanks for this.

The setup works as far as I can switch between the images with the switch and the default value on the UserDataFloat.

But it doesn't pick the file from the spriteNumPP.

Typing spriteNumPP or (nparticlename).spriteNumPP in the attribute box doesn't seem to do anything.

Could you be a bit more specific on how to hook this up.

Also would you know a way to fix the sprite twist that doesn't seem compatible with arnold as well.

 

Regards.

Message 8 of 15
Stephen.Blair
in reply to: Anonymous

 

 

  1. With the particle shape node selected, open the Add Dynamic Attributes section of the Attribute Editor and click the General button.
  2. In the Add Attribute window, click the Particle tab and select spriteNumPP. Click OK.

    This adds the per particle spriteNumPP attribute to the particle shape node. The spriteNumPP attribute works like Sprite Num, but you can set spriteNumPP on a per particle basis.

  3. Write a creation expression to animate the particle shape node’s spriteNumPP attribute.  For example:

    nParticleShape1.spriteNumPP = trunc( rand( 3 ) )

 

  • Assign an Arnold shader to the nParticle node. For example, a standard surface.
  • Connect a switch node to the color parameter
  • Connect a user data float node to the Index parameter of the switch node
  • In the user data float node, enter spriteNumPP in the Attribute text box
  • Connect textures to the input0, input1, ... parameters

 

In the Attribute Editor for the nParticles node, scroll down to the Arnold section.

Enter spriteNumPP in the Export Attributes box



// Stephen Blair
// Arnold Renderer Support
Message 9 of 15
Anonymous
in reply to: Stephen.Blair

Got it to work now.

I think I had a cache that was stuck that made every particle have number 2.

 

Thanks a lot.

Message 10 of 15
mspeer
in reply to: Anonymous

Hi!

@Anonymous 

Yes, "Smoke" does not solve it.

I mentioned this for @jordan.giboney (or other people from Autodesk) to be able to reproduce the problem easily.

Sorry, if my wording was not clear.

Message 11 of 15
Stephen.Blair
in reply to: Anonymous


@Anonymous wrote:

Also would you know a way to fix the sprite twist that doesn't seem compatible with arnold as well.

 


  • Arnold sprites have a rotation parameter.
  • So, add a dynamic, per-particle attribute named rotation
  • Define a creation expression for rotation, such as nParticleShape1.rotation = rand (-180,180);
  • Add rotation to the Export Attributes


// Stephen Blair
// Arnold Renderer Support
Message 12 of 15
Anonymous
in reply to: Stephen.Blair

This works great,

thanks a lot.

 

I actually did the expression on spriteTwistPP and then made the rotation attribute and linked it on creation and runtime with:

spriteTwistPP = rotation;

 

That way what you see in the viewport is what you get in the render.

Message 13 of 15
Anonymous
in reply to: Stephen.Blair

This works fine, very useful,  thank you yet I would like to go a step further by adding the alpha channel pertaining to each image of the sprites. Also I'd need to have the opacityPP driven by the normalized age to make the sprites fade out over time as the particles reach their lifetimePP. Is this possible? Any suggestions would be greatly appreciated. Thanks in advance.

Message 14 of 15
doodski
in reply to: Stephen.Blair

Man I'm having a similar issue as the other guy. I've set mine up as suggested and It will only cycle the images all together instead of Per particle, so on frame one they're all the same image. I've downloaded your file and taken a look and it looks as though mine should work.  I've even replaced my nodes with the same utilities you're using. I've tried my usual sprite cycle methods too but they don't seem to transfer properly. maybe later I can upload a simple setup and see if you can tell what the discrepancy is. 

 

 

Message 15 of 15
doodski
in reply to: doodski

maybe there's some funky stuff happening in my file since I started with something that already had some expressions triggered and it's getting hung up. I added file textures to your test file and it works so I might just need to try a clean setup. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report