メインコンテンツまでスキップ

blendReflect: Intense Highlight Creation

Mathematical Foundation of Reflect

Reflect blending creates intense highlights by squaring the base color and dividing by the inverted blend color. This mathematical operation produces dramatic brightening effects similar to photographic reflection.

The mathematical definition is:

Cresult={1if Cblend=1min(Cbase21Cblend,1)otherwiseC_{result} = \begin{cases} 1 & \text{if } C_{blend} = 1 \\ \min\left(\frac{C_{base}^2}{1 - C_{blend}}, 1\right) & \text{otherwise} \end{cases}

The squaring operation amplifies bright base values while the division creates non-linear intensity increases as blend approaches white.

Reflection Enhancement Properties

PropertyDescriptionMathematical Behavior
Quadratic AmplificationBase values squaredCbase2C_{base}^2 increases contrast
Division IntensificationInverted blend divisionBright blend creates strong effect
Highlight PreservationWhite blend preserves maximumSafe upper bound
Non-linear ResponseExponential brightness curveDramatic lighting simulation
ライブエディター
const fragment = () => {
      const base = vec3(0.6, 0.8, 0.9)
      const reflection = float(0.6).smoothstep(0.2, uv.distance(vec2(0.7, 0.3)))
      const blend = vec3(reflection.mul(0.8))
      const result = blendReflectVec3(base, blend)
      return vec4(result, 1)
}