[x3d-public] VariationPhysicsModel for ParticleSystem using programmable shaders
John Carlson
yottzumm at gmail.com
Mon Apr 22 18:21:52 PDT 2024
My thought is to add a new input variable in to shader,
in float[] myVariable;
Then provide
<field name=“myVariable” type=“MFFloat” accessType=“inputOnly” value=“…”/>
In the ComposedShader.
But I don’t know currently how to tie a particle physics model to a
composed shader, nor how to address instances of geometry. The work I’ve
done so far addresses all instances, and uses scripts, not wind.
So I need to look into source code a bit.
It would seem that naming individual floats might provide better
documentation. I guess an MFFloat is less wordy, and a single float
MFFloat can serve as an SFFloat.
John
On Mon, Apr 22, 2024 at 7:53 PM John Carlson <yottzumm at gmail.com> wrote:
> Also, one could provide Variational Physics Models that apply to all
> particles or one particle.
>
> WindPhysicsModel already does this, but the 6 variational physics models
> I’m imagining affects each particle.
>
> I’ll probably start coding this up tonight, if no one else volunteers.
>
> I don’t know if I need a Script per particle or not. I’m thinking I need
> to provide toNode and toField (ROUTEs), but on a particle level, so perhaps
> I need a specialized ROUTE.
>
> How might we combine this with InstancedShape? Can we add
> ParticleSystems’ PhysicsModels to InstancedShape?
>
> I’m looking for more collaboration on reducing the number of Scripts I use.
>
> I’m now seeing that float arrays are a thing in custom shaders, so perhaps
> for my 6 shader parameters, a single variational physics model is all that
> is required, with 2 MFFloats, one for values, and one for variation of
> values.
>
> Thanks!
>
> John
>
> On Mon, Apr 22, 2024 at 7:24 PM John Carlson <yottzumm at gmail.com> wrote:
>
>> Holger, I would like to provide 2 sets of (SFVec3f of values as well as
>> an SFVec3f of variation corresponding to the values). My thought is to use
>> PhysicsModels in the ParticleSystems. These are not emitters, but
>> something more like a WindPhysicsModel, they parametrically alter the shape
>> of geometry over time in a ComposedShader. There are actually 6 individual
>> SFFloats of values, so technically, I might use 6 WindPhysicsModels,
>> sending speed into the programmable shader, and providing gustiness for
>> variation. But this is not wind, and AFAIK, X_ITE and Sunrize does wind
>> with the WindPhysicsModel. Is there another PhysicsModel available, or
>> should I write my own?
>>
>> Would it be better to use 2 MFFloats, and how do I send an MFFloat to the
>> ComposedShader?
>>
>> Thanks!
>>
>> John
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240422/42b8e051/attachment.html>
More information about the x3d-public
mailing list