Skip to content

Commit

Permalink
Add option for defining accent color
Browse files Browse the repository at this point in the history
  • Loading branch information
struffel committed Aug 5, 2023
1 parent 6d952d8 commit 87d439a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 5 additions & 4 deletions docs/docs/parameter-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ This view shows the HDRI map with three reference balls to evaluate the lighting

| Key | Description | Possible Values |
| --- | --- | --- |
| `spheres_enable` <span style="opacity:0%;user-select:none;" >PADDING_PADDING_PADDING</span>| Show the light probe spheres in the center of the frame. | `0`=off<br> `1`=on |
| `spheres_enable` <span style="opacity:0%;user-select:none;" >PADDING_PADDING_PADDING</span>| Show the light probe spheres in the center of the frame. | `0`=off<br> `1`=on (default) |
| `spheres_accent_color` | Set the color of the middle sphere. | Hex color code, like `116DD5` (default) |
| `environment_tonemapping` | Tonemapping style to use. | `linear` (recommended for an analytical look) or `filmic` (for a "prettier" look with tonemapping.) |
| `environment_exposure` | Exposure offset in EVs. | Any integer or decimal number. Negative values darken the image, positive brighten it. |
|`environment_url`| Link to one or multiple equirectangular HDR panoramas in `hdr` or `exr` file format.|Comma-separated list of URLs ending in `.hdr` or `.exr`. |
|`environment_name`| List of names for the environments. Required if more than one environment is used. |Comma-separated list of strings.|
|`environment_index`| Describes which environment should be displayed (if multiple are specified in the URL list.) |`0` (for the first environment)<br> `1` (for the second environment)<br> ...|
| `environment_url`| Link to one or multiple equirectangular HDR panoramas in `hdr` or `exr` file format.|Comma-separated list of URLs ending in `.hdr` or `.exr`. |
| `environment_name`| List of names for the environments. Required if more than one environment is used. |Comma-separated list of strings.|
| `environment_index`| Describes which environment should be displayed (if multiple are specified in the URL list.) |`0` (for the first environment)<br> `1` (for the second environment)<br> ...|
| `watermark_enable` | Enables or disables the PBR.ONE watermark. | `2` = large (default)<br> `1` = small<br> `0` = off |
| `gui_enable` | Enables or disables the GUI in the top left corner. | `1` = enabled on start (default)<br> `0` = disabled on start<br> `-1` = disabled entirely |

Expand Down
9 changes: 7 additions & 2 deletions src/js/views/hdri-shading.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ function updateScene(oldSceneConfiguration,newSceneConfiguration){
THREE_ACTIONS.updateSceneEnvironment(envFileUrl,scene,renderer);
}
}

// Accent color
glossySphere.material.color.set(parseInt(newSceneConfiguration['spheres_accent_color'],16));

}

Expand All @@ -62,7 +65,9 @@ function initializeScene(){

"environment_url" : [],
"environment_name": [],
"environment_index":0
"environment_index":0,

"spheres_accent_color": "116DD5"

});

Expand All @@ -83,7 +88,7 @@ function initializeScene(){

glossySphere = new THREE.Mesh(
new THREE.SphereGeometry(0.33,128,128),
new THREE.MeshPhysicalMaterial({"color":0x116DD5,"roughness":0})
new THREE.MeshPhysicalMaterial({"color":parseInt("116DD5",16),"roughness":0})
);
glossySphere.position.z = 0;

Expand Down

0 comments on commit 87d439a

Please sign in to comment.