particle sprite Arnold

Anonymous

particle sprite Arnold

Anonymous
Not applicable

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.

0 Likes
Reply
Accepted solutions (2)
3,446 Views
14 Replies
Replies (14)

jordan.giboney
Autodesk Support
Autodesk Support

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


0 Likes

Anonymous
Not applicable

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.

0 Likes

mspeer
Consultant
Consultant

Hi!

I can confirm this.

It's easy reproducible by using:

Effects -> Smoke

0 Likes

Stephen.Blair
Community Manager
Community Manager

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
0 Likes

Anonymous
Not applicable

Hi mspeer,

thanks for the response.

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

Still arnold just picks one file.

Regards.

0 Likes

Anonymous
Not applicable

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.

0 Likes

Stephen.Blair
Community Manager
Community Manager
Accepted solution

 

 

  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
0 Likes

Anonymous
Not applicable

Got it to work now.

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

 

Thanks a lot.

0 Likes

mspeer
Consultant
Consultant

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.

0 Likes

Stephen.Blair
Community Manager
Community Manager
Accepted solution

@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
0 Likes

Anonymous
Not applicable

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.

0 Likes

Anonymous
Not applicable

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.

0 Likes

doodski
Enthusiast
Enthusiast

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. 

 

 

0 Likes

doodski
Enthusiast
Enthusiast

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. 

0 Likes