Page MenuHome

Geometry Nodes: Add shader Color Mix node
ClosedPublic

Authored by Charlie Jolly (charlie) on Mar 2 2021, 7:08 PM.

Details

Summary

Port shader to Geometry Nodes.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 16499
Build 16499: arc lint + arc unit

Event Timeline

Charlie Jolly (charlie) requested review of this revision.Mar 2 2021, 7:08 PM
Charlie Jolly (charlie) created this revision.
Charlie Jolly (charlie) edited the summary of this revision. (Show Details)
Hans Goudey (HooglyBoogly) requested changes to this revision.Mar 8 2021, 9:46 PM

I think the conversion to C++ should happen in a different commit / patch. Do you have commit rights @Charlie Jolly (charlie)?

This revision now requires changes to proceed.Mar 8 2021, 9:46 PM

I think the conversion to C++ should happen in a different commit / patch. Do you have commit rights @Charlie Jolly (charlie)?

I do but not used for a while!

For some reason I cannot apply the patch easily.

I haven't tested it right now, but I think you can simplify the code significantly by using this:

static void sh_node_mix_rgb_expand_in_mf_network(blender::nodes::NodeMFNetworkBuilder &builder)
{
  bNode &node = builder.bnode();
  bool clamp = node.custom2 & SHD_MIXRGB_CLAMP;
  int mix_type = node.custom1;
  builder.construct_and_set_matching_fn<MixRGBFunction>(clamp, mix_type);
}
Jacques Lucke (JacquesLucke) requested changes to this revision.Mar 15 2021, 1:15 PM
Charlie Jolly (charlie) retitled this revision from Geometry Nodes: Add shader Color Mix node to Geometry Nodes: Add shader Color Mix node.

Address comments

See D11506 for patch for c++ conversion. I'll update this patch once that is accepted.

Rebase and update after D11506

Hans Goudey (HooglyBoogly) requested changes to this revision.Aug 11 2021, 9:28 PM

This crashes for me when I add the node. I believe part of the signature building is missing, which is especially notable when compared to other nodes.

This revision now requires changes to proceed.Aug 11 2021, 9:28 PM

Add missing signature function.

source/blender/nodes/shader/nodes/node_shader_mixRgb.cc
172

Can you just use clamp_v3?

Charlie Jolly (charlie) marked an inline comment as done.Aug 18 2021, 3:30 PM
This revision is now accepted and ready to land.Aug 18 2021, 3:42 PM
This revision was automatically updated to reflect the committed changes.