Page MenuHome

Cycles: Add smoothing option to the Brick Texture
ClosedPublic

Authored by Lukas Stockner (lukasstockner97) on Sep 14 2016, 6:43 PM.

Diff Detail

Repository
rB Blender

Event Timeline

very useful! :)

example render

Brecht Van Lommel (brecht) requested changes to this revision.

Seems fine, but can we enable some smoothing by default, so you get better looking displacement without having to know to tweak this setting? I'm not sure what a good default value would be.

intern/cycles/kernel/shaders/node_brick_texture.osl
31–32

The builtin OSL smoothstep(0.0, 1.0, x) does the same I think.

This revision now requires changes to proceed.Sep 17 2016, 1:13 PM

By the way, eventually it would be nice to automatically filter all texture types with ray differentials. But unfortunately these are not available in SVM currently.

Lukas Stockner (lukasstockner97) removed rB Blender as the repository for this revision.

Yes, OSL's smoothstep is indeed better here.
I'm not sure about default smoothing, since it would change existing scenes - maybe it'd be possible to set smoothing to zero while loading .blends, but having a default in new nodes?

Brecht Van Lommel (brecht) accepted this revision.

I'm not sure about default smoothing, since it would change existing scenes - maybe it'd be possible to set smoothing to zero while loading .blends, but having a default in new nodes?

Should be possible in versioning code, or setting the default value in node_shader_init_tex_brick like this:

for (bNodeSocket *sock = node->inputs.first; sock; sock = sock->next) {
    if (STREQ(sock->name, "Mortar Smooth")) {
        ((bNodeSocketValueFloat*)sock->default_value)->value = 0.1f;
    }
}
This revision is now accepted and ready to land.Oct 18 2016, 3:56 AM
This revision was automatically updated to reflect the committed changes.