MCPcopy Create free account
hub / github.com/RenderKit/oidn / getInput

Function getInput

devices/gpu/gpu_input_process.h:37–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35 bool snorm; // signed normalized ([-1..1])
36
37 oidn_device_inline vec3f getInput(int h, int w) const
38 {
39 vec3f value = input.get3(h, w);
40
41 // Scale
42 value = value * transferFunc.getInputScale();
43
44 // Sanitize
45 value = math::clamp(math::nan_to_zero(value), snorm ? -1.f : 0.f, hdr ? FLT_MAX : 1.f);
46
47 if (snorm)
48 {
49 // Transform to [0..1]
50 value = value * 0.5f + 0.5f;
51 }
52
53 // Apply the transfer function
54 value = transferFunc.forward(value);
55
56 return value;
57 }
58
59 oidn_device_inline vec3f getAlbedo(int h, int w) const
60 {

Callers 2

operator ()Function · 0.85

Calls 4

nan_to_zeroFunction · 0.85
get3Method · 0.80
clampFunction · 0.50
forwardMethod · 0.45

Tested by

no test coverage detected