Instance Noodle Displacement both direction of axis


#1

Hallo I am trying to displace vertices in both directions of a given axis using a control texture. Using RGB mode I would expect for every vertex a point in the texture to be sampled, obtained its rgb values and these values be used as X Y Z values.
It seems like only the red is used as also was noticed in:

Either a bug or I am not fully understanding what RGB mode is.
tx
S.
DisplacementMapping.v4p (21.2 KB)


#2

This work for you?
https://www.dropbox.com/s/0u9zyezlkojuf1o/DisplacmentMapNoTess.gsfx?dl=1


#3

Yes this indeed works, I have also noticed a couple of error in the same fx coming stock with Instance Noodle, so that must have been the problem.

Now that I got RGB displacement working, although that is not what I needed (axis displace is just fine), at least I ve found out what is my is my issue: understanding how to work with negative valued colours.

Say I have a texture with different shades of grey, where 50% grey represents no displacement, black represents displacement in one direction of the selected axis and white the other direction.
So, all I need is to do is to remap black/white to “negative white/white”, any hint while Windows is updating ?
tx


#4

Just subtract 0.5 from your colour map before sampling it, grey becomes 0, black -.5, white .5. That help?


#5

@io there was indeed a bug where by RGB was only sampling red. If that works for you now I’ll add it to the github and eventually the contrib.

For doing basic math on textures I quite like ‘ScalarOperation’ from @microdee’s mp.dx pack


#6

Yes it does work for me the previously attached .gsfx

And also got proper texture remapping, thanks
S.