OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1873 // First time only. | 1873 // First time only. |
1874 g_reflectionSurfaceSet = g_mainPack.createObject('RenderSurfaceSet'); | 1874 g_reflectionSurfaceSet = g_mainPack.createObject('RenderSurfaceSet'); |
1875 g_refractionSurfaceSet = g_mainPack.createObject('RenderSurfaceSet'); | 1875 g_refractionSurfaceSet = g_mainPack.createObject('RenderSurfaceSet'); |
1876 } | 1876 } |
1877 | 1877 |
1878 // Create Render Targets for the reflection and refraction. | 1878 // Create Render Targets for the reflection and refraction. |
1879 g_reflectionTexture = g_mainPack.createTexture2D(g_renderTargetWidth, | 1879 g_reflectionTexture = g_mainPack.createTexture2D(g_renderTargetWidth, |
1880 g_renderTargetHeight, | 1880 g_renderTargetHeight, |
1881 g_o3d.Texture.ARGB8, 1, | 1881 g_o3d.Texture.ARGB8, 1, |
1882 true); | 1882 true); |
1883 var reflectionSurface = g_reflectionTexture.getRenderSurface(0, g_mainPack); | 1883 var reflectionSurface = g_reflectionTexture.getRenderSurface(0); |
1884 g_refractionTexture = g_mainPack.createTexture2D(g_renderTargetWidth, | 1884 g_refractionTexture = g_mainPack.createTexture2D(g_renderTargetWidth, |
1885 g_renderTargetHeight, | 1885 g_renderTargetHeight, |
1886 g_o3d.Texture.XRGB8, 1, | 1886 g_o3d.Texture.XRGB8, 1, |
1887 true); | 1887 true); |
1888 var refractionSurface = g_refractionTexture.getRenderSurface(0, g_mainPack); | 1888 var refractionSurface = g_refractionTexture.getRenderSurface(0); |
1889 g_depthSurface = g_mainPack.createDepthStencilSurface(g_renderTargetWidth, | 1889 g_depthSurface = g_mainPack.createDepthStencilSurface(g_renderTargetWidth, |
1890 g_renderTargetHeight); | 1890 g_renderTargetHeight); |
1891 | 1891 |
1892 // Set up the render graph to generate them. | 1892 // Set up the render graph to generate them. |
1893 g_reflectionSurfaceSet.renderSurface = reflectionSurface; | 1893 g_reflectionSurfaceSet.renderSurface = reflectionSurface; |
1894 g_reflectionSurfaceSet.renderDepthStencilSurface = g_depthSurface; | 1894 g_reflectionSurfaceSet.renderDepthStencilSurface = g_depthSurface; |
1895 | 1895 |
1896 g_refractionSurfaceSet.renderSurface = refractionSurface; | 1896 g_refractionSurfaceSet.renderSurface = refractionSurface; |
1897 g_refractionSurfaceSet.renderDepthStencilSurface = g_depthSurface; | 1897 g_refractionSurfaceSet.renderDepthStencilSurface = g_depthSurface; |
1898 | 1898 |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2731 | 2731 |
2732 /** | 2732 /** |
2733 * Removes any callbacks so they don't get called after the page has unloaded. | 2733 * Removes any callbacks so they don't get called after the page has unloaded. |
2734 */ | 2734 */ |
2735 function uninit() { | 2735 function uninit() { |
2736 if (g_client) { | 2736 if (g_client) { |
2737 g_client.cleanup(); | 2737 g_client.cleanup(); |
2738 } | 2738 } |
2739 } | 2739 } |
2740 | 2740 |
OLD | NEW |