Skip to content

Commit

Permalink
Added controls for KHR_materials_iridescence to the web app UI
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalSchoen committed Oct 5, 2021
1 parent 6e4294a commit d3068fb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions app_web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ <h2 class="title is-spaced">Advanced Controls</h2>
<b-switch class="smallerLabel" v-bind:disabled="transmissionEnabled === false ? true : false" v-model="volumeEnabled">KHR_materials_volume</b-switch>
<b-switch class="smallerLabel" v-model="iorEnabled">KHR_materials_ior</b-switch>
<b-switch class="smallerLabel" v-model="specularEnabled">KHR_materials_specular</b-switch>
<b-switch class="smallerLabel" v-model="iridescenceEnabled">KHR_materials_iridescence</b-switch>
</b-field>
<b-field label="Statistics" class="subtitle">
<json-to-ui-template v-bind:data="statistics" v-bind:isinner="false"></json-to-ui-template>
Expand Down
2 changes: 2 additions & 0 deletions app_web/src/logic/uimodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class UIModel
map( ({ newValue, oldValue }) => newValue));
this.iorEnabled = app.$watchAsObservable('iorEnabled').pipe(
map( ({ newValue, oldValue }) => newValue));
this.iridescenceEnabled = app.$watchAsObservable('iridescenceEnabled').pipe(
map( ({ newValue, oldValue }) => newValue));
this.specularEnabled = app.$watchAsObservable('specularEnabled').pipe(
map( ({ newValue, oldValue }) => newValue));
this.iblEnabled = app.iblChanged$.pipe(pluck("event", "msg"));
Expand Down
3 changes: 3 additions & 0 deletions app_web/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ async function main()
uiModel.iorEnabled.subscribe( iorEnabled => {
state.renderingParameters.enabledExtensions.KHR_materials_ior = iorEnabled;
});
uiModel.iridescenceEnabled.subscribe( iridescenceEnabled => {
state.renderingParameters.enabledExtensions.KHR_materials_iridescence = iridescenceEnabled;
});
uiModel.specularEnabled.subscribe( specularEnabled => {
state.renderingParameters.enabledExtensions.KHR_materials_specular = specularEnabled;
});
Expand Down
1 change: 1 addition & 0 deletions app_web/src/ui/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const app = new Vue({
transmissionEnabled: true,
volumeEnabled: true,
iorEnabled: true,
iridescenceEnabled: true,
specularEnabled: true,

activeTab: 0,
Expand Down
2 changes: 1 addition & 1 deletion assets/models
Submodule models updated 274 files

0 comments on commit d3068fb

Please sign in to comment.