Skip to content

Commit b0b7978

Browse files
- Updated Lightsources
- Added support for multiple color spaces for Materials in v2 - Added metal material values in ACEScg format
1 parent 1a91917 commit b0b7978

File tree

7 files changed

+972
-144
lines changed

7 files changed

+972
-144
lines changed

deploy/lightsources.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@
273273
"category": ["Artificial"],
274274
"description": "Displays like computer monitors, TVs, signage, etc. Typically they have a temperature of 6500K but it can vary. The sRGB spec for monitors targets 80 cd/m2. Typically, monitors calibrated for broadcast or studio color grading should have a brightness of 100 cd/m2 in Japan and in the United States, or 120 cd/m2 in the European Union. This is however considered quite dark for normal use, so consumer monitors tend to be brighter.",
275275
"sources": [
276-
"https://www.digitalview.com/blog/lcd-panels-backlights-brightness/",
277276
"https://en.wikipedia.org/wiki/Color_temperature",
278277
"https://en.wikipedia.org/wiki/Candela_per_square_metre"
279278
],

deploy/openapi-schema-v2.yaml

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,21 @@ components:
101101
description: Name of the material.
102102
default: Name
103103
color:
104-
$ref: '#/components/schemas/color'
105-
description: 'Specifies the diffuse or metallic reflectance color, or in the case of a transparent material, transmission color. RGB triplet in decimal format in linear sRGB color space.'
104+
type: array
105+
description: 'Specifies the diffuse or metallic reflectance color, or in the case of a transparent material, transmission color.'
106+
minItems: 1
107+
uniqueItems: true
108+
items:
109+
$ref: '#/components/schemas/color'
106110
metalness:
107111
type: number
108112
description: Specifies how metallic the material appears (dials the shading model from pure dielectric to pure metal).
109113
specularColor:
110-
$ref: '#/components/schemas/color'
114+
type: array
111115
description: 'Color of the specular reflection for metals, specified in the "Gulbrandsen edge tint" format. Calculated from spectral data using script from https://github.com/natyh/material-params'
116+
minItems: 1
117+
items:
118+
$ref: '#/components/schemas/color'
112119
roughness:
113120
type: number
114121
description: 'The roughness of the specular reflection. Lower numbers produce sharper reflections, higher numbers produce blurrier reflections.'
@@ -128,10 +135,22 @@ components:
128135
complexIor:
129136
type: array
130137
description: 'Complex IOR values, n (refractive index), and k (extinction coefficient), for each color channel, in the following order: nR, kR, nG, kG, nB, kB. Calculated from spectral IOR data files.'
131-
minItems: 6
132-
maxItems: 6
133138
items:
134-
type: number
139+
type: object
140+
properties:
141+
colorSpace:
142+
type: string
143+
description: The color space for which the n and k values have been calculated for.
144+
nk:
145+
type: array
146+
description: 'N and k values for each RGB color channel in the following order: nR, kR, nG, kG, nB, kB.'
147+
minItems: 6
148+
maxItems: 6
149+
items:
150+
type: number
151+
required:
152+
- colorSpace
153+
- nk
135154
thinFilmThickness:
136155
type: array
137156
description: 'The thickness of the thin film layer on the base (in nanometers). If there''s no variation, only one value should be specified. A range can be specified with two values. A third value can be added to specify the most common thickness.'
@@ -280,12 +299,23 @@ components:
280299
'600': 'https://raw.githubusercontent.com/AntonPalmqvist/physically-based-api/main/images/renders/cycles/600/aluminum.avif'
281300
format: avif
282301
color:
283-
type: array
302+
type: object
284303
title: color
285-
minItems: 3
286-
maxItems: 3
287-
items:
288-
type: number
304+
properties:
305+
colorSpace:
306+
type: string
307+
description: The color space.
308+
default: srgb-linear
309+
color:
310+
type: array
311+
description: RGB triplet (vec3) in decimal format.
312+
minItems: 3
313+
maxItems: 3
314+
items:
315+
type: number
316+
required:
317+
- colorSpace
318+
- color
289319
description:
290320
type: string
291321
title: description

deploy/openapi-schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ components:
9494
default: Name
9595
color:
9696
$ref: '#/components/schemas/color'
97-
description: 'The albedo of non-metals, or reflection color of metals, RGB triplet in linear decimal format with rec709 primaries.'
97+
description: 'Specifies the diffuse or metallic reflectance color, or in the case of a transparent material, transmission color. RGB triplet (vec3) in linear decimal format in rec709 primaries.'
9898
metalness:
9999
type: number
100100
description: Specifies how metallic the material appears (dials the shading model from pure dielectric to pure metal).

deploy/v2/lightsources.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,6 @@
374374
"category": ["Artificial"],
375375
"description": "Displays like computer monitors, TVs, signage, etc. typically have a temperature of 6500K but it can vary. The sRGB spec for monitors targets 80 cd/m2 at 6500K. Typically, monitors calibrated for broadcast or studio color grading should have a brightness of 100 cd/m2 in Japan and in the United States, or 120 cd/m2 in the European Union. This is however considered quite dark for normal use, so consumer monitors tend to be brighter, and HDR displays even brighter.",
376376
"references": [
377-
{
378-
"title": "LCD Panels - Backlights & Brightness",
379-
"url": "https://www.digitalview.com/blog/lcd-panels-backlights-brightness/",
380-
"publisher": "Digital View ",
381-
"accessed": "2025-02-27"
382-
},
383377
{
384378
"title": "Color temperature",
385379
"author": "Wikipedia contributors",

0 commit comments

Comments
 (0)