Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -333,9 +333,9 @@ with gr.Blocks(css=css) as demo:
|
|
333 |
result = gr.Model3D(label="3D Mesh", clear_color=[0.5, 0.5, 0.5, 0.0], camera_position=[0, 90, 0])
|
334 |
html = gr.HTML(value="<label for='zoom'>Zoom</label><input id='zoom' type='range' style='width:256px;height:1em;' min='0.157' max='1.57' step='0.001' oninput='BABYLON.Engine.LastCreatedScene.getNodes()[1].material.pointSize=Math.ceil(Math.log2(Math.PI/this.value));BABYLON.Engine.LastCreatedScene.activeCamera.fov=this.value;this.parentNode.childNodes[2].innerText=BABYLON.Engine.LastCreatedScene.activeCamera.fov;'/><span>0.8</span>")
|
335 |
camera = gr.HTML(value="<a href='#' onclick=\"BABYLON.Engine.LastCreatedScene.activeCamera.radius=0;\">reset camera</a>")
|
336 |
-
contrast = gr.HTML(value="<label for='contrast'>Contrast</label><input id='contrast' type='range' style='width:256px;height:1em;' min='0' max='2' step='0.001' oninput='if(!BABYLON.Engine.LastCreatedScene.activeCamera.metadata){BABYLON.Engine.LastCreatedScene.activeCamera.metadata = { pipeline: new BABYLON.DefaultRenderingPipeline(\"default\", true, BABYLON.Engine.LastCreatedScene, [BABYLON.Engine.LastCreatedScene.activeCamera])
|
337 |
-
exposure = gr.HTML(value="<label for='exposure'>Exposure</label><input id='exposure' type='range' style='width:256px;height:1em;' min='0' max='2' step='0.001' oninput='if(!BABYLON.Engine.LastCreatedScene.activeCamera.metadata){BABYLON.Engine.LastCreatedScene.activeCamera.metadata = { pipeline: new BABYLON.DefaultRenderingPipeline(\"default\", true, BABYLON.Engine.LastCreatedScene, [BABYLON.Engine.LastCreatedScene.activeCamera])
|
338 |
-
|
339 |
canvas = gr.HTML(value="<a href='#' onclick=\"this.innerText=document.getElementsByClassName('model3D')[0].getElementsByTagName('canvas')[0].getContext('webgl2');\">webgl2</a>")
|
340 |
render = gr.Button("Render")
|
341 |
|
|
|
333 |
result = gr.Model3D(label="3D Mesh", clear_color=[0.5, 0.5, 0.5, 0.0], camera_position=[0, 90, 0])
|
334 |
html = gr.HTML(value="<label for='zoom'>Zoom</label><input id='zoom' type='range' style='width:256px;height:1em;' min='0.157' max='1.57' step='0.001' oninput='BABYLON.Engine.LastCreatedScene.getNodes()[1].material.pointSize=Math.ceil(Math.log2(Math.PI/this.value));BABYLON.Engine.LastCreatedScene.activeCamera.fov=this.value;this.parentNode.childNodes[2].innerText=BABYLON.Engine.LastCreatedScene.activeCamera.fov;'/><span>0.8</span>")
|
335 |
camera = gr.HTML(value="<a href='#' onclick=\"BABYLON.Engine.LastCreatedScene.activeCamera.radius=0;\">reset camera</a>")
|
336 |
+
contrast = gr.HTML(value="<label for='contrast'>Contrast</label><input id='contrast' type='range' style='width:256px;height:1em;' min='0' max='2' step='0.001' oninput='if(!BABYLON.Engine.LastCreatedScene.activeCamera.metadata){BABYLON.Engine.LastCreatedScene.activeCamera.metadata = { pipeline: new BABYLON.DefaultRenderingPipeline(\"default\", true, BABYLON.Engine.LastCreatedScene, [BABYLON.Engine.LastCreatedScene.activeCamera]) }} BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.contrast=this.value;this.parentNode.childNodes[2].innerText=BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.contrast;'/><span>1.0</span>")
|
337 |
+
exposure = gr.HTML(value="<label for='exposure'>Exposure</label><input id='exposure' type='range' style='width:256px;height:1em;' min='0' max='2' step='0.001' oninput='if(!BABYLON.Engine.LastCreatedScene.activeCamera.metadata){BABYLON.Engine.LastCreatedScene.activeCamera.metadata = { pipeline: new BABYLON.DefaultRenderingPipeline(\"default\", true, BABYLON.Engine.LastCreatedScene, [BABYLON.Engine.LastCreatedScene.activeCamera]) }} BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure=this.value;this.parentNode.childNodes[2].innerText=BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure;'/><span>1.0</span>")
|
338 |
+
blur = gr.HTML(value="<label for='blur'>Blur</label><input id='blur' type='range' style='width:256px;height:1em;' min='0' max='4' step='0.001' oninput='if(!BABYLON.Engine.LastCreatedScene.activeCamera.metadata){BABYLON.Engine.LastCreatedScene.activeCamera.metadata = { pipeline: new BABYLON.DefaultRenderingPipeline(\"default\", true, BABYLON.Engine.LastCreatedScene, [BABYLON.Engine.LastCreatedScene.activeCamera]) }} BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.depthOfFieldEnabled=true;BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.depthOfFieldBlurLevel=this.value;this.parentNode.childNodes[2].innerText=BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.depthOfFieldBlurLevel;'/><span>1.0</span>")
|
339 |
canvas = gr.HTML(value="<a href='#' onclick=\"this.innerText=document.getElementsByClassName('model3D')[0].getElementsByTagName('canvas')[0].getContext('webgl2');\">webgl2</a>")
|
340 |
render = gr.Button("Render")
|
341 |
|