Download

Floor Doesn't work with Vertex Colors?

I’ve been working with vertex colors a bit lately, because I have a mesh that has multiple distinct parts, and I thought it might be better than using a texture for no reason [and I had some misconceptions about the vertex shader vs the fragment shader at the time] (especially since this is just something that will be far away and instanced a bunch). So I had for the most part figured out a setup that would make this work, when I ran into an interesting issue.

When I used the “Floor” node, as in the following graph:
[SPOILER]31ff9bcb56cbf333ed13c9be2ea01b63bf1bd99a.png[/SPOILER]

It results in the following (the colors that are being used are for demonstrative purposes):

Whereas Ceil works perfectly fine, as far as I can tell. Which means Floor can still be (mostly) simulated by subtracting by 0.99, clamping between 0 and 1, and taking the Ceil of it:
[SPOILER]a97588a17aa008183c75657827c1112a7779b9a6.png[/SPOILER]

Which gives the expected result (still awful colors, though):
[SPOILER]

[/SPOILER]

So even though I found a (seemingly) workable solution, I had to ask. Is Floor acting like this on vertex colors for everyone else? Is it supposed to do this? Is this a bug, or do I just not fully understand the pieces at work?

Also, this may help if someone else ran into a similar problem, I suppose.

I would greatly appreciate any information people have about this.

Oh thanks, i run in the same problem. Your solution works fine, but as you (after some researching), i couldn’t find the reason why “floor” acting only by vertex colors like this.