Page MenuHome

Geometry Nodes: Add White Noise texture
ClosedPublic

Authored by Charlie Jolly (charlie) on Sep 30 2021, 10:04 PM.

Details

Diff Detail

Repository
rB Blender

Event Timeline

Charlie Jolly (charlie) requested review of this revision.Sep 30 2021, 10:04 PM
Charlie Jolly (charlie) created this revision.
Jacques Lucke (JacquesLucke) requested changes to this revision.Oct 1 2021, 1:38 PM
Jacques Lucke (JacquesLucke) added inline comments.
source/blender/blenlib/intern/noise.cc
243
[3/50] Building CXX object source/blender/blenlib/CMakeFiles/bf_blenlib.dir/intern/noise.cc.o
/home/jacques/blender-git/blender/source/blender/blenlib/intern/noise.cc:243:7: warning: no previous declaration for ‘float blender::noise::hash_float2_to_float(blender::float2)’ [-Wmissing-declarations]
  243 | float hash_float2_to_float(float2 k)
      |       ^~~~~~~~~~~~~~~~~~~~
/home/jacques/blender-git/blender/source/blender/blenlib/intern/noise.cc:248:7: warning: no previous declaration for ‘float blender::noise::hash_float4_to_float(blender::float4)’ [-Wmissing-declarations]
  248 | float hash_float4_to_float(float4 k)
      |       ^~~~~~~~~~~~~~~~~~~~

I wonder, does this have to be a different function than hash_float_to_float(float2 k)? Maybe only one of the two is necessary. If only your new method is the one we should use, fine with me, but I'm not sure. Needs to be investigated.

248

This function isn't used.

258

That's probably for consistency, but it does look a bit unnecessary to hash the constant 1.0 as well. Fortunately, that will probably be optimized away by the compiler.

source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc
29

This also needs a change in MOD_nodes_evaluator.cc in get_socket_value.

This revision now requires changes to proceed.Oct 1 2021, 1:38 PM
Charlie Jolly (charlie) marked 4 inline comments as done.Oct 2 2021, 4:23 PM
Charlie Jolly (charlie) added inline comments.
source/blender/blenlib/intern/noise.cc
248

I've included hash functions ready for other shaders. Maybe a separate commit?

258

This is a copy of the cycles code. Perhaps it can be optimised later if the compiler doesn't do that.

Charlie Jolly (charlie) updated this revision to Diff 42813.EditedOct 2 2021, 4:25 PM
Charlie Jolly (charlie) marked 2 inline comments as done.

Use cycles compatible hash functions. Prefixed with shd_. Reply to comments.

Update to master. Dependent on D12725: Geometry Nodes: Add Voronoi Texture as hash functions need changing.

This patch has to be updated for master a bit, but the code looks fine.

source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc
194

No need to add this comment.

This revision is now accepted and ready to land.Oct 14 2021, 3:28 PM
Charlie Jolly (charlie) marked an inline comment as done.Oct 14 2021, 3:55 PM

This revision was automatically updated to reflect the committed changes.