Message 1 of 4
nParticles per-point attribute access in shader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm trying access particle data from within an OSL shader. For example, I would like to store some vector attribute per-point and query that at shading time.
Is this possible? Pretty new to working with particles in OSL and can't find much info about it.
I'm finding following info in blender's osl implementation, is there an equivalent in arnold's implementation?
particle:index- Particle instance number.
particle:age- Particle age in frames.
particle:lifetime- Total lifespan of particle in frames.
particle:location- Location of the particle.
particle:size- Size of the particle.
particle:velocity- Velocity of the particle.
particle:angular_velocity- Angular velocity of the particle.
Edit: it seems I can read some per-particle attributes using getattribute("worldPosition", ...). All I have to do is export them in the nParticle shape node under Export Attributes. I can't seem to get this to work for "worldBirthPosition" though. Any ideas?
Thanks, Zeno