15 vout = vin * 2.0f - 1.0f;
22 vout =
clamp(vin, half_texel_size.xyy(), 1.0f - half_texel_size.xyy);
31 if (vin.
x == 0.0f && vin.
y == 0.0f) {
51 v = (vin.
z + 1.0f) * 0.5f;
52 float len =
sqrt(vin.
x * vin.
x + vin.
y * vin[1]);
67#if defined(GPU_FRAGMENT_SHADER) || defined(GLSL_CPP_STUBS)
173 float limit = 0.5f + 0.5f * blend;
176 weight =
N.xyz / (
N.xyx +
N.yzz);
177 weight =
clamp((weight - 0.5f * (1.0f - blend)) /
max(1e-8f, blend), 0.0f, 1.0f);
180 if (
N.z < (1.0f - limit) * (
N.y +
N.x)) {
182 weight.
y = 1.0f - weight.
x;
184 else if (
N.x < (1.0f - limit) * (
N.y +
N.z)) {
186 weight.
z = 1.0f - weight.
y;
188 else if (
N.y < (1.0f - limit) * (
N.x +
N.z)) {
190 weight.
x = 1.0f - weight.
z;
194 weight = ((2.0f - limit) *
N + (limit - 1.0f)) /
max(1e-8f, blend);
197 color = weight.
x * color1 + weight.
y * color2 + weight.
z * color3;
216 color =
float4(1.0f, 0.0f, 1.0f, 1.0f);
238 float2 f0 = w1 / (w0 + w1);
239 float2 f1 = w3 / (w2 + w3);
242 final_co.xy = tc - 1.0f + f0;
243 final_co.zw = tc + 1.0f + f1;
244 final_co /= tex_size.xyxy;
252 color =
float4(1.0f, 0.0f, 1.0f, 1.0f);
float texture_lod_bias_get(KernelGlobals &kg)
void cubic_bspline_coefficients(float2 f, float2 &w0, float2 &w1, float2 &w2, float2 &w3)
float4 texture_bicubic(sampler2D sampler_2d, float2 coordinates)
float dot(VecOp< float, D >, VecOp< float, D >) RET
constexpr T clamp(T, U, U) RET
float length(VecOp< float, D >) RET
SamplerBase< float, 1, false, true > sampler1DArray
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
TEX_TEMPLATE DataVec textureLod(T, FltCoord, float) RET
TEX_TEMPLATE DataVec textureGrad(T, FltCoord, DerivVec, DerivVec) RET
SamplerBase< float, 2, false, true > sampler2DArray
SamplerBase< float, 2 > sampler2D
TEX_TEMPLATE SizeVec textureSize(T, int) RET
void node_tex_image_linear(float3 co, sampler2D ima, KernelGlobals &kg, float4 &color, float &alpha)
void point_map_to_tube(float3 vin, float3 &vout)
void tex_box_sample_linear(float3 texco, float3 N, sampler2D ima, KernelGlobals &, float4 &color1, float4 &color2, float4 &color3)
void tex_box_blend(float3 N, float4 color1, float4 color2, float4 color3, float blend, float4 &color, float &alpha)
void point_texco_remap_square(float3 vin, float3 &vout)
void node_tex_image_empty(float3, float4 &color, float &alpha)
void node_tex_tile_cubic(float3 co, sampler2DArray ima, sampler1DArray map, float4 &color, float &alpha)
void tex_box_sample_cubic(float3 texco, float3 N, sampler2D ima, KernelGlobals &kg, float4 &color1, float4 &color2, float4 &color3)
void point_map_to_sphere(float3 vin, float3 &vout)
void point_texco_clamp(float3 vin, sampler2D ima, float3 &vout)
void node_tex_image_cubic(float3 co, sampler2D ima, KernelGlobals &, float4 &color, float &alpha)
void node_tex_tile_linear(float3 co, sampler2DArray ima, sampler1DArray map, float4 &color, float &alpha)
bool tiled_image_lookup(float3 &co, sampler2DArray, sampler1DArray map)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)