summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3d-webgl-samples/bubbles/js/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/samples/o3d-webgl-samples/bubbles/js/main.js')
-rw-r--r--o3d/samples/o3d-webgl-samples/bubbles/js/main.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/o3d/samples/o3d-webgl-samples/bubbles/js/main.js b/o3d/samples/o3d-webgl-samples/bubbles/js/main.js
index a8fa92f..f7500f3e48 100644
--- a/o3d/samples/o3d-webgl-samples/bubbles/js/main.js
+++ b/o3d/samples/o3d-webgl-samples/bubbles/js/main.js
@@ -64,6 +64,7 @@ var g_controls;
var g_done = false;
var g_useCubeMap;
var g_blipDistortion;
+var g_blendTwice;
/**
* Initializes the o3d clients.
@@ -99,7 +100,7 @@ function initStep2(clientElements) {
// Set the clear color to the default set in the HTML input fields.
updateClearColor();
- // Use Z-Sorting to draw bubbles back-to-front.
+ // Sort method for the draw pass.
g_viewInfo.performanceDrawPass.sortMethod = g_o3d.DrawList.BY_Z_ORDER;
// Set some blending states.
@@ -111,6 +112,12 @@ function initStep2(clientElements) {
state.getStateParam('SeparateAlphaBlendEnable').value = false;
state.getStateParam('AlphaBlendEnable').value = true;
+ state.getStateParam('ZEnable').value = false;
+ state.getStateParam('ZWriteEnable').value = false;
+
+ // By default, cull all the back faces.
+ state.getStateParam('CullMode').value = g_o3d.State.CULL_CW;
+
// Creates a transform to put our data in.
g_dataroot = g_pack.createObject('Transform');
g_dataroot.parent = g_client.root;
@@ -127,6 +134,9 @@ function initStep2(clientElements) {
// Use the environment map?
g_useCubeMap = paramObject.createParam('useCubeMap', 'ParamBoolean');
g_useCubeMap.value = true;
+ // Should shader effect be amplified for more vibrant bubbles?
+ g_blendTwice = paramObject.createParam('blendTwice', 'ParamBoolean');
+ g_blendTwice.value = true;
// Number, location and overall effect of the modulation map.
g_blipDistortion = paramObject.createParam('distortion', 'ParamFloat');
g_blipDistortion.value = bsh.Globals.kBlipDistortion;