Help Coloring half of a rope - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Help Coloring half of a rope (/thread-3081.html) |
Coloring half of a rope - Nyxtra - 26-08-2021 Hi! I'm using ObiRopeLineRenderer to render my rope. In certain places on the rope its halves need to be different colors, I am attaching a picture with an example. To do this i assign colors in the solver array, and in alpha channel I specify which half should be colored. When mesh is updated in renderer I then assign vertex colors according to alpha. This works mostly fine, except for cases when half that needs to be colored changes, like in the picture. When two neighboring vertices have the same color, there is a line across that is brigther than sides by themselves. Is there any way I could avoid this? Maybe make this line less bright? Appreciate any advice! RE: Coloring half of a rope - josemendez - 26-08-2021 (26-08-2021, 09:29 AM)Nyxtra Wrote: Hi! Hi there! This can’t really be avoided: at points where curvature changes sign or the side you’re coloring changes, vertex color interpolation will result in the brighter line you see across. It’s just how rendering works: vertex data is interpolated to fragments. You might get lucky by disabling interpolation for color in your vertex shader, using interpolation qualifiers: https://stackoverflow.com/questions/13876763/cg-specify-a-variable-not-to-be-interpolated-between-vertex-and-fragment-shader?rq=1 RE: Coloring half of a rope - Nyxtra - 26-08-2021 (26-08-2021, 01:35 PM)josemendez Wrote: Hi there! Thank you for your reply! I'll give it a try. |