i just tried deriving the color channel from a gradient in a texmap input.
To do that i added a KCM to write into the texcoords channel.
The texcoords were derived by a “blend” of two vectors with the velocity beeing the blend amount and the vectors beeing 0,0,0 and 1,1,1
It seems to kind of work, but it looks as if the texcoords would be tiling (wrapping, looping however you’d call that in this case )
The texmap is set to explicit mapchannel and all other default and is a simple gradient ramp.
The Blend Operator expects a control value (Input3) between 0.0 and 1.0, but it does NOT clamp the 3rd Input, so what you are feeding in can be any value. And of course your Velocity channel is not clamped between 0 and 1 so you will get tiling. You could do the following:
This will normalize the blend value to be between 0 and 1 as the velocity magnitude changes between 0 and 10. If you want to ensure no tiling will ever happen, you can pass the result of the Divide through a Clamp Op with Float inputs of 0.0 and 1.0.
EDIT: Looks like Gradient Ramp shoots over the tiling border, so the top clamp value should be 0.99 and not 1.0 to avoid black pixels.
Hmm this was pretty much what i was doing. I had to take REALLY low values to make it somehow work…velocity magnitude is WAY beyond 10. And i couldnt find
a value that was working as expected. But i will investigate and shall report (What i did was investigate the velocity magnitude by stuffing it into the color channel
and rendering with density 1/1 to get normalized velocity)
I used 10 because that worked well in my case. Your velocity could be anything (units per second). If you see tiling, your control value is not normalized/clamped well. And the clamping has to be between 0 and 0.99 to avoid a bit of tiling at the edges of the gradient.
Until we get the Debug Info mode implemented, you can simply load a single particle (or very few) and save the Krakatoa output to a CSV file for looking…
K, that sounds like a nice way to go about it. As after checking again and WITH a clamp in place it still misbehaves…so will manually check velocities.