Vertex Colors

Discussion related to the LuxCore functionality, implementations and API.
Post Reply
User avatar
stanland
Posts: 19
Joined: Fri Sep 14, 2018 12:16 pm

Vertex Colors

Post 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?
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Vertex Colors

Post 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
Attachments
2018-09-15_10-39-32.png
User avatar
stanland
Posts: 19
Joined: Fri Sep 14, 2018 12:16 pm

Re: Vertex Colors

Post 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? :)
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Vertex Colors

Post 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 :) )
User avatar
stanland
Posts: 19
Joined: Fri Sep 14, 2018 12:16 pm

Re: Vertex Colors

Post 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! :)
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Vertex Colors

Post 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 ?
Support LuxCoreRender project with salts and bounties
User avatar
stanland
Posts: 19
Joined: Fri Sep 14, 2018 12:16 pm

Re: Vertex Colors

Post 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
User avatar
stanland
Posts: 19
Joined: Fri Sep 14, 2018 12:16 pm

Re: Vertex Colors

Post 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?
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Vertex Colors

Post 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.
Attachments
2018-09-19_18-24-03.png
luxcore vertex colors multiple.blend
(1.45 MiB) Downloaded 197 times
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Vertex Colors

Post 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.
Support LuxCoreRender project with salts and bounties
Post Reply