Hi, I’m trying to make a shader that contains vertices within specified bounds. I’ve gotten it to work with local positions, but I can’t figure out how to make the bounds world positions. I’m using _Min and _Max to define the bounds. You can see my attempt to change _Min and _Max to world positions where the commented lines are, but when I used them in the clamp function, the results looked the same. I’m trying to make it so that when I move the position of the object, the bounds don’t move with it.
I tried it both ways, and they both yielded the same results. I can’t figure out why though. Here’s some images attached with localMin and localMax applied. I also added #include UnityCg.cginc. The expected results of moving it would be for example, in picture 01 the box would be visible, then flattened against the x wall in 02. By the way, I just image manipulated the Inspector and Hierarchy to be in more convenient places.
maybe you just forgot to put localMin and localMax in the clamp function and left it as _Min.xyz, _Max.xyz?
Not sure what else it could be. I will try it when I get home.
Yeah, I can’t figure out why this is wrong. I checked to make sure I’m not editing the wrong script and that I’m using localMin and localMax with clamp. Here’s my copy past just to make sure.