public static void addDefaultResourceLocators() { try { ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_MATERIAL, new SimpleResourceLocator(ResourceLocatorTool.getClassPathResource(EffectUtils.class, "com/ardor3d/extension/effect/material"))); ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_SHADER, new SimpleResourceLocator(ResourceLocatorTool.getClassPathResource(EffectUtils.class, "com/ardor3d/extension/effect/shader"))); } catch (final URISyntaxException ex) { ex.printStackTrace(); } } }
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; }
public static RenderMaterial loadChecked(final String sourceUrl) throws IOException { final ResourceSource source = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_MATERIAL, sourceUrl); if (source == null) { throw new IOException("Unable to locate '" + sourceUrl + "'"); } return load(source); }
final URL u = ResourceLocatorTool.getClassPathResource(ResourceLocatorTool.class, resourceName); if (u != null) { return new URLResourceSource(u);
if (addLocator) { loc = new RelativeResourceLocator(resource); ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE, loc); } else { loc = null; ResourceLocatorTool.removeResourceLocator(ResourceLocatorTool.TYPE_TEXTURE, loc);
final URL u = ResourceLocatorTool.getClassPathResource(ResourceLocatorTool.class, resourceName); if (u != null) { return new URLResourceSource(u);
public static void addDefaultResourceLocators() { try { ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_MATERIAL, new SimpleResourceLocator(ResourceLocatorTool.getClassPathResource(SkinnedMesh.class, "com/ardor3d/extension/animation/skeletal/material"))); ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_SHADER, new SimpleResourceLocator(ResourceLocatorTool.getClassPathResource(SkinnedMesh.class, "com/ardor3d/extension/animation/skeletal/shader"))); } catch (final URISyntaxException ex) { ex.printStackTrace(); } } }
URL url = ResourceLocatorTool.getClassPathResource(BMFontProvider.class, resource); try { if (url != null) { url = ResourceLocatorTool.getClassPathResource(BMFontProvider.class, resource); closest.bmFont = new BMFont(new URLResourceSource(url), false);
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; }
public RenderMaterial findMaterial(final String materialUrl) { final ResourceSource key = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_MATERIAL, materialUrl); if (key == null) { return null; } RenderMaterial mat = _materialCache.get(key); if (mat == null) { mat = YamlMaterialReader.load(key); if (mat != null) { _materialCache.put(key, mat); } } return mat; }
public static void addDefaultResourceLocators() { try { ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_MATERIAL, new SimpleResourceLocator( ResourceLocatorTool.getClassPathResource(Terrain.class, "com/ardor3d/extension/terrain/material"))); ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_SHADER, new SimpleResourceLocator( ResourceLocatorTool.getClassPathResource(Terrain.class, "com/ardor3d/extension/terrain/shader"))); } catch (final URISyntaxException ex) { ex.printStackTrace(); } } }
URL url = ResourceLocatorTool.getClassPathResource(BMFontProvider.class, resource); try { if (url != null) { url = ResourceLocatorTool.getClassPathResource(BMFontProvider.class, resource); closest.bmFont = new BMFont(new URLResourceSource(url), false);
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; }
/** * Loads a texture by attempting to locate the given name using ResourceLocatorTool. * * @param name * the name of the texture image. * @param minFilter * the filter for the near values. Used to determine if we should generate mipmaps. * @param flipVertically * If true, the image is flipped vertically during image loading. * @return the loaded texture. */ public static Texture load(final String name, final Texture.MinificationFilter minFilter, final boolean flipVertically) { return load(ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, name), minFilter, TextureStoreFormat.GuessNoCompressedFormat, flipVertically); }
vertexShader = new UrlInputSupplier(ResourceLocatorTool.getClassPathResource(Terrain.class, "com/ardor3d/extension/terrain/texturedGeometryClipmapShader.vert")); pixelShader = new UrlInputSupplier(ResourceLocatorTool.getClassPathResource(Terrain.class, "com/ardor3d/extension/terrain/texturedGeometryClipmapShader.frag"));
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; }
/** * Loads a texture by attempting to locate the given name using ResourceLocatorTool. * * @param name * the name of the texture image. * @param minFilter * the filter for the near values. Used to determine if we should generate mipmaps. * @param flipVertically * If true, the image is flipped vertically during image loading. * @return the loaded texture. */ public static Texture load(final String name, final Texture.MinificationFilter minFilter, final boolean flipVertically) { return load(ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, name), minFilter, TextureStoreFormat.GuessNoCompressedFormat, flipVertically); }
jsEngine.eval(new InputStreamReader(ResourceLocatorTool.getClassPathResourceAsStream(JSLayerImporter.class, "com/ardor3d/extension/animation/skeletal/state/loader/functions.js")));
/** * Loads a texture by attempting to locate the given name using ResourceLocatorTool. * * @param name * the name of the texture image. * @param minFilter * the filter for the near values. Used to determine if we should generate mipmaps. * @param format * the specific format to use when storing this texture on the card. * @param flipVertically * If true, the image is flipped vertically during image loading. * @return the loaded texture. */ public static Texture load(final String name, final Texture.MinificationFilter minFilter, final TextureStoreFormat format, final boolean flipVertically) { return load(ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, name), minFilter, format, flipVertically); }
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; }