Page 1 of 1

Vertex Colors

Posted: Sat Sep 15, 2018 7:22 am
by stanland
Hi Lux community!

This is my first post here! :) My question is? In cycles you can use Attribute node to be able to use multiple vertex colors, can you do similar thing in Lux?

Re: Vertex Colors

Posted: Sat Sep 15, 2018 8:42 am
by B.Y.O.B.
LuxCore currently only supports one set of vertex colors per mesh.
In Blender, the active vertex color layer is used: https://github.com/LuxCoreRender/BlendL ... ct.py#L176
"active" is interpreted like in the attached picture at the moment.

However now that you mention it, this behaviour is not really logical (the one with the camera icon should be used instead), so I will change this behaviour for future versions: https://github.com/LuxCoreRender/BlendL ... issues/213

Re: Vertex Colors

Posted: Sat Sep 15, 2018 8:50 am
by stanland
B.Y.O.B. wrote: Sat Sep 15, 2018 8:42 am LuxCore currently only supports one set of vertex colors per mesh.
In Blender, the active vertex color layer is used: https://github.com/LuxCoreRender/BlendL ... ct.py#L176
"active" is interpreted like in the attached picture at the moment.

However now that you mention it, this behaviour is not really logical (the one with the camera icon should be used instead), so I will change this behaviour for future versions.
Is there any plans in the future to add multiple vertex color support in one mesh? :)

Re: Vertex Colors

Posted: Sat Sep 15, 2018 8:55 am
by B.Y.O.B.
I think you are the first to request this feature.
You can open an issue here to make a feature request so it is not forgotten: https://github.com/LuxCoreRender/LuxCore/issues

We also do a features poll after a release to decide which features to implement next, here is the last one: viewtopic.php?f=5&t=308
(so you see we still have a lot of work to do :) )

Re: Vertex Colors

Posted: Mon Sep 17, 2018 5:32 am
by stanland
B.Y.O.B. wrote: Sat Sep 15, 2018 8:55 am I think you are the first to request this feature.
You can open an issue here to make a feature request so it is not forgotten: https://github.com/LuxCoreRender/LuxCore/issues

We also do a features poll after a release to decide which features to implement next, here is the last one: viewtopic.php?f=5&t=308
(so you see we still have a lot of work to do :) )
I opened feature request in github! :)

Re: Vertex Colors

Posted: Mon Sep 17, 2018 9:48 am
by Dade
Can you explain me how exactly multiple vertex colors are used (in Blender) ? Is there the option to select which set to use in texture nodes ?

Is the first set always used for shading the triangles ? Did they include alpha information ?

Re: Vertex Colors

Posted: Mon Sep 17, 2018 1:49 pm
by stanland
Dade wrote: Mon Sep 17, 2018 9:48 am Can you explain me how exactly multiple vertex colors are used (in Blender) ? Is there the option to select which set to use in texture nodes ?

Is the first set always used for shading the triangles ? Did they include alpha information ?
I made a blend file you can check, it should at least show how i use vertex colors.
https://www.dropbox.com/s/7b365l74gage9 ... blend?dl=0

Re: Vertex Colors

Posted: Wed Sep 19, 2018 12:49 pm
by stanland
stanland wrote: Mon Sep 17, 2018 1:49 pm
Dade wrote: Mon Sep 17, 2018 9:48 am Can you explain me how exactly multiple vertex colors are used (in Blender) ? Is there the option to select which set to use in texture nodes ?

Is the first set always used for shading the triangles ? Did they include alpha information ?
I made a blend file you can check, it should at least show how i use vertex colors.
https://www.dropbox.com/s/7b365l74gage9 ... blend?dl=0
Did my blend file helped?

Re: Vertex Colors

Posted: Wed Sep 19, 2018 4:29 pm
by B.Y.O.B.
@Dade:
I think all I would need in LuxCore would be an index.

Code: Select all

scene.textures.<texture name>.type = "hitpointcolor"
scene.textures.<texture name>.index = 2
As far as I know Blender vertex colors do not include an alpha channel.
Dade wrote: Mon Sep 17, 2018 9:48 am Is the first set always used for shading the triangles ?
What do you mean?
In Cycles, vertex color layers are accessed by name with a special node. They are not used for shading by default.
stanland wrote: Mon Sep 17, 2018 1:49 pm I made a blend file you can check, it should at least show how i use vertex colors.
https://www.dropbox.com/s/7b365l74gage9 ... blend?dl=0
In your special case, since you only need one channel per mix node, you can paint into the red/green/blue channels of the vertex colors and extract them with LuxCore nodes.
However this only allows up to 3 channels, not sure if that is enough for your projects.
I attached an example how to do your setup in Lux.

Re: Vertex Colors

Posted: Wed Sep 19, 2018 6:48 pm
by Dade
B.Y.O.B. wrote: Wed Sep 19, 2018 4:29 pm
Dade wrote: Mon Sep 17, 2018 9:48 am Is the first set always used for shading the triangles ?
What do you mean?
In Cycles, vertex color layers are accessed by name with a special node. They are not used for shading by default.
I was thinking to old SLG where, if the vertices had colors defined, they were interpolated across the triangle and used for the rendering but it has been than replaced by the "hitpointcolor" texture mechanic.