Currently there’s a few options for Lookup POPs which are in the case of Texture, for example: Normalized and Pixel Index + Lookup Offset.
However, for example working with the P attribute as a Lookup Attribute, you are very unlikely to be in a normalized range, take for example a non-square point grid and a non-square image. Re-ranging your points to normalized, doing the lookup, then re-ranging to their original scale is doable, once or twice, but gets cumbersome and cluttered quickly.
My proposal is per-axis re-ranging added to the lookups next to the offset of the lookup attributes.
My workaround so far to make my life easier is the following:
in your particular case where you use a point grid, you can make use of the attributes associated with the grid’s dimensions. If the dimensions of the texture and the grid match, then _DimI[n] would work, or you use the normalized version of _DimU[n]
Currently disabled, but looking into it, would be to use the Transform POP’s “Transform Attribute Scope as Position” mode to create a normalized copy of P and use that for the lookup. This then would be especially interesting if your points are not a grid but for example generated from a Point Generator POP where dimension is not available in this way.
Thanks Markus, the _DimI[n] or DimU works indeed when there is dimension information, but that is lost for example after a Particle POP and even so, would not be useful any more.
To give you more context I have two options in my 2D particle lookup, one is an “at birth” Noise / Wind (etc) lookup, and the other is an “update” mode which is the same lookup but part of the Particle feedback loop: meaning particles that pass over other texture lookup pixel values (thanks to their updated position in the loop), have their forces adjusted.
Keeping a normalized copy of positions is only good for one “update” pass, another comes and re-normalization is required, so first updating positions based on Curl Noise lookup, and then Wind, etc and the normalization is needed before/between any of those.
Also by normalization I don’t mean the Align options in the Transform POP, rather re-scaling based on the shared aspect ratio, since Align normalization will be “jumpy” if used with particles in-motion as part of the feedback loop.
I took a deeper look into what you’re saying and also using PartForce instead of updating the position in the loop. In that case I just need to re-scale the particle positions to normalized after the Particle POP in each frame to have a normalized lookup attribute, which I can use for all my lookups in the loop.