This makes it possible to restore previous Blender 4.3 behavior of bump mapping, where the large filter width was sometimes (ab)used to get a bevel like effect on stepwise textures. For bump from the displacement socket, filter width remains fixed at 0.1. Ref #133991, #135841 Pull Request: https://projects.blender.org/blender/blender/pulls/136465
23 lines
602 B
Plaintext
23 lines
602 B
Plaintext
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
|
|
|
#include "oslutil.h"
|
|
#include "stdcycles.h"
|
|
|
|
shader node_wireframe(string bump_offset = "center",
|
|
float bump_filter_width = BUMP_FILTER_WIDTH,
|
|
int use_pixel_size = 0,
|
|
float Size = 0.01,
|
|
output float Fac = 0.0)
|
|
{
|
|
if (bump_offset == "dx") {
|
|
P += Dx(P) * bump_filter_width;
|
|
}
|
|
else if (bump_offset == "dy") {
|
|
P += Dy(P) * bump_filter_width;
|
|
}
|
|
|
|
Fac = wireframe("triangles", Size, use_pixel_size);
|
|
}
|