87 3D: Materials and lights
3D reference map · First 3D picture
procedure
(material3d [ #:color color #:shading shading #:lighting lighting #:ambient ambient #:diffuse diffuse #:specular specular #:specular-color specular-color #:roughness roughness #:emission emission #:emission-strength emission-strength #:double-sided? double-sided? #:casts-shadow? casts-shadow? #:receives-shadow? receives-shadow? #:wireframe? wireframe?]) → material3d? color : color-spec? = "cornflowerblue" shading : (or/c 'unlit 'flat 'smooth) = 'flat lighting : (or/c 'lambert 'blinn-phong) = 'lambert ambient : nonnegative-real? = 1 diffuse : nonnegative-real? = 1 specular : nonnegative-real? = 0 specular-color : color-spec? = "white" roughness : (and/c positive-real? (<=/c 1)) = 1 emission : color-spec? = "black" emission-strength : nonnegative-real? = 0 double-sided? : boolean? = #f casts-shadow? : boolean? = #t receives-shadow? : boolean? = #t wireframe? : boolean? = #f
The OpenGL preparation resolves the complete ordered light list once under the same request-owned color context. Uniform packing and shadow-light selection consume those numerical RGBA values; authored light values remain unchanged for inspection. A resolved translucent light is rejected before a GPU draw.
procedure
(material3d? value) → boolean?
value : any/c
procedure
(material3d-color material) → color-spec?
material : material3d?
procedure
(material3d-shading material) → (or/c 'unlit 'flat 'smooth)
material : material3d?
procedure
(material3d-lighting material) → (or/c 'lambert 'blinn-phong)
material : material3d?
procedure
(material3d-ambient material) → nonnegative-real?
material : material3d?
procedure
(material3d-diffuse material) → nonnegative-real?
material : material3d?
procedure
(material3d-specular material) → nonnegative-real?
material : material3d?
procedure
(material3d-specular-color material) → color-spec?
material : material3d?
procedure
(material3d-roughness material)
→ (and/c positive-real? (<=/c 1)) material : material3d?
procedure
(material3d-specular-exponent material) → positive-real?
material : material3d?
procedure
(material3d-emission material) → color-spec?
material : material3d?
procedure
(material3d-emission-strength material) → nonnegative-real?
material : material3d?
procedure
(material3d-double-sided? material) → boolean?
material : material3d?
procedure
(material3d-casts-shadow? material) → boolean?
material : material3d?
procedure
(material3d-receives-shadow? material) → boolean?
material : material3d?
procedure
(material3d-wireframe? material) → boolean?
material : material3d?
procedure
(material3d-with-color material color) → material3d?
material : material3d? color : color-spec?
procedure
(material3d-with-roughness material roughness) → material3d? material : material3d? roughness : (and/c positive-real? (<=/c 1))
procedure
(material3d-with-emission material emission [ #:strength strength]) → material3d? material : material3d? emission : color-spec?
strength : nonnegative-real? = (material3d-emission-strength material)
procedure
(material3d-with-shadow-policy material [ #:casts-shadow? casts-shadow? #:receives-shadow? receives-shadow?]) → material3d? material : material3d? casts-shadow? : boolean? = (material3d-casts-shadow? material)
receives-shadow? : boolean? = (material3d-receives-shadow? material)