protected GLSLShaderObjectsState getExtractionShader() { final GLSLShaderObjectsState shader = new GLSLShaderObjectsState(); try { shader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "fsq.vert")); shader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "bloom_extract.frag")); } catch (final Exception e) { e.printStackTrace(); } shader.setUniform("inputTex", 0); return shader; }
protected GLSLShaderObjectsState getBlurHorizShader() { final GLSLShaderObjectsState shader = new GLSLShaderObjectsState(); try { shader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "fsq.vert")); shader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "gausian_blur_horizontal9.frag")); } catch (final Exception e) { e.printStackTrace(); } shader.setUniform("inputTex", 0); return shader; }
private RenderState getLuminanceExtractionShader() { final GLSLShaderObjectsState shader = new GLSLShaderObjectsState(); try { shader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(ColorReplaceEffect.class, shaderDirectory + "fsq.vert")); shader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(ColorReplaceEffect.class, shaderDirectory + "luminance.frag")); } catch (final Exception e) { e.printStackTrace(); } shader.setUniform("inputTex", 0); return shader; }
protected GLSLShaderObjectsState getBlurVertShader() { final GLSLShaderObjectsState shader = new GLSLShaderObjectsState(); try { shader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "fsq.vert")); shader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "gausian_blur_vertical9.frag")); } catch (final Exception e) { e.printStackTrace(); } shader.setUniform("inputTex", 0); return shader; }
jsEngine.eval(new InputStreamReader(ResourceLocatorTool.getClassPathResourceAsStream(JSLayerImporter.class, "com/ardor3d/extension/animation/skeletal/state/loader/functions.js")));
protected GLSLShaderObjectsState getBlendShader() { final GLSLShaderObjectsState shader = new GLSLShaderObjectsState(); try { shader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "fsq.vert")); shader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "add2textures.frag")); } catch (final Exception e) { e.printStackTrace(); } shader.setUniform("tex1", 0); shader.setUniform("tex2", 1); return shader; }
jsEngine.eval(new InputStreamReader(ResourceLocatorTool.getClassPathResourceAsStream(JSLayerImporter.class, "com/ardor3d/extension/animation/skeletal/state/loader/functions.js")));
private RenderState getBrightMapShader() { final GLSLShaderObjectsState shader = new GLSLShaderObjectsState(); try { shader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(ColorReplaceEffect.class, shaderDirectory + "fsq.vert")); shader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(ColorReplaceEffect.class, shaderDirectory + "brightmap.frag")); } catch (final Exception e) { e.printStackTrace(); } shader.setUniform("inputTex", 0); shader.setUniform("lum1x1Tex", 1); shader.setUniform("exposurePow", 3.0f); shader.setUniform("exposureCutoff", 0.0f); return shader; }
_pssmShader = new GLSLShaderObjectsState(); try { _pssmShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream( ParallelSplitShadowMapPass.class, "com/ardor3d/extension/shadow/map/pssm.vert")); if (filter == Filter.None) { _pssmShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream( ParallelSplitShadowMapPass.class, "com/ardor3d/extension/shadow/map/pssm.frag")); } else if (filter == Filter.Pcf) { _pssmShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream( ParallelSplitShadowMapPass.class, "com/ardor3d/extension/shadow/map/pssmPCF.frag")); _pssmDebugShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream( ParallelSplitShadowMapPass.class, "com/ardor3d/extension/shadow/map/pssmDebug.vert")); _pssmDebugShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream( ParallelSplitShadowMapPass.class, "com/ardor3d/extension/shadow/map/pssmDebug.frag")); } catch (final IOException ex) {
private GLSLShaderObjectsState getColorizeShader() { final GLSLShaderObjectsState shader = new GLSLShaderObjectsState(); try { shader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(ColorReplaceEffect.class, shaderDirectory + "fsq.vert")); shader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(ColorReplaceEffect.class, shaderDirectory + "color_replace.frag")); } catch (final Exception e) { e.printStackTrace(); } shader.setUniform("inputTex", 0); shader.setUniform("colorRampTex", 1); shader.setUniform("redWeight", _redWeight); shader.setUniform("greenWeight", _greenWeight); shader.setUniform("blueWeight", _blueWeight); return shader; }
waterShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(WaterNode.class, currentShaderStr + ".vert")); waterShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(WaterNode.class, currentShaderStr + ".frag")); } catch (final IOException e) { blurShaderVertical.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(WaterNode.class, "com/ardor3d/extension/effect/bloom/bloom_blur.vert")); blurShaderVertical.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(WaterNode.class, "com/ardor3d/extension/effect/bloom/bloom_blur_vertical5_down.frag")); } catch (final IOException ex) {
public void reloadShader() { textureClipmapShader = new GLSLShaderObjectsState(); try { textureClipmapShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(TextureClipmap.class, "com/ardor3d/extension/terrain/textureClipmapShader.vert")); textureClipmapShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream( TextureClipmap.class, "com/ardor3d/extension/terrain/textureClipmapShader.frag")); } catch (final IOException ex) { TextureClipmap.logger.logp(Level.SEVERE, getClass().getName(), "init(Renderer)", "Could not load shaders.", ex); } textureClipmapShader.setUniform("texture", 0); textureClipmapShader.setUniform("scale", 1f / scale); textureClipmapShader.setUniform("textureSize", (float) textureSize); textureClipmapShader.setUniform("texelSize", 1f / textureSize); textureClipmapShader.setUniform("levels", (float) textureLevels); textureClipmapShader.setUniform("validLevels", (float) validLevels - 1); textureClipmapShader.setUniform("minLevel", 0f); textureClipmapShader.setUniform("showDebug", showDebug ? 1.0f : 0.0f); }
extractionShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "bloom_extract.vert")); extractionShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "bloom_extract.frag")); } catch (final IOException ex) { blurShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "bloom_blur.vert")); blurShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "bloom_blur.frag")); } catch (final IOException ex) { blurShaderHorizontal.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream( BloomRenderPass.class, shaderDirectory + "bloom_blur.vert")); blurShaderHorizontal.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream( BloomRenderPass.class, shaderDirectory + "bloom_blur_horizontal7.frag")); } catch (final IOException ex) { blurShaderVertical.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "bloom_blur.vert")); blurShaderVertical.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream( BloomRenderPass.class, shaderDirectory + "bloom_blur_vertical7.frag")); } catch (final IOException ex) { finalShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "bloom_final.vert")); finalShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(BloomRenderPass.class, shaderDirectory + "bloom_final.frag")); } catch (final IOException ex) {