One-parameter shader

calendar_today

04.09.2022

label

Rendering

mouse

Houdini 18.0

Description

Experimental shader ranging from metallic to emissive with just one float slider.

1 Description

A minimalist one-parameter shader that smoothly runs from emissive (0.0), over translucent (0.75), to diffuse (1.0) and opaque (1.25) to metallic (2.0).

C
        float shading = chf('shading');
vector color = chv('color');

vector pos_light = {2.6, 1.2, 0.6};
vector dir = normalize(pos_light - v@P);

float lumen = max(1.0 - shading, 0.0);
float angle = max(dot(dir, v@N), lumen);
shading = fit(shading, 1, 2, 1, 20);
float shade = pow(angle, max(shading, 1.0));

v@Cd = color * shade;
    
link

Related articles

favorite

209

label

Rendering

Low poly helicopter on a CRT screen

favorite

256

label

Rendering

Raymarching Meshes

favorite

310

label

Rendering

Render Cartoon Outlines in SOPs

favorite

306

label

Rendering

UV coordinates and displacements in Mantra

favorite

330

label

Rendering

Wireframe shader in Mantra

favorite

294

label

RenderingEnvironment

Artistic viewport landscape