public Texture2DTrilinearFilter(String file) { super(file); bind(); trilinearFilter(); unbind(); }
GLTexture diffusemap = new Texture2DTrilinearFilter(properties.getProperty("materials.material" + i + "_DIF")); getMaterials().get(materials.size()-1).setDiffusemap(diffusemap); GLTexture normalmap = new Texture2DTrilinearFilter(properties.getProperty("materials.material" + i + "_NRM")); getMaterials().get(materials.size()-1).setNormalmap(normalmap); GLTexture heightmap = new Texture2DTrilinearFilter(properties.getProperty("materials.material" + i + "_DISP")); getMaterials().get(materials.size()-1).setHeightmap(heightmap);
public UnderWaterRenderer() { underWaterShader = UnderWaterShader.getInstance(); underwaterSceneTexture = new Texture2DBilinearFilterRGBA16F(BaseContext.getWindow().getWidth(), BaseContext.getWindow().getHeight()); underwaterSceneTexture.bind(); underwaterSceneTexture.clampToEdge(); underwaterSceneTexture.unbind(); dudvMap = new Texture2DTrilinearFilter("textures/water/dudv/dudv1.jpg"); causticsMap = new Texture2DTrilinearFilter("textures/water/caustics/caustics.jpg"); GLContext.getResources().setUnderwaterCausticsMap(causticsMap); GLContext.getResources().setUnderwaterDudvMap(dudvMap); }
private static Material<GLTexture> processMaterial(AIMaterial aiMaterial, String texturesDir) { AIString path = AIString.calloc(); Assimp.aiGetMaterialTexture(aiMaterial, Assimp.aiTextureType_DIFFUSE, 0, path, (IntBuffer) null, null, null, null, null, null); String textPath = path.dataString(); GLTexture diffuseTexture = null; if (textPath != null && textPath.length() > 0) { diffuseTexture = new Texture2DTrilinearFilter(texturesDir + "/" + textPath); } AIColor4D color = AIColor4D.create(); Vec3f diffuseColor = null; int result = Assimp.aiGetMaterialColor(aiMaterial, Assimp.AI_MATKEY_COLOR_AMBIENT, Assimp.aiTextureType_NONE, 0, color); if (result == 0) { diffuseColor = new Vec3f(color.r(), color.g(), color.b()); } Material<GLTexture> material = new Material<GLTexture>(); material.setDiffusemap(diffuseTexture); material.setColor(diffuseColor); return material; }
public Sun(){ getWorldTransform().setLocalTranslation(GLDirectionalLight.getInstance().getDirection().mul(-2600)); Vec3f origin = new Vec3f(0,0,0); Vec3f[] array = new Vec3f[1]; array[0] = origin; GLPointVBO3D buffer = new GLPointVBO3D(); buffer.addData(array); Material<GLTexture> material1 = new Material<GLTexture>(); material1.setDiffusemap(new Texture2DTrilinearFilter("textures/sun/sun.png")); Material<GLTexture> material2 = new Material<GLTexture>(); material2.setDiffusemap(new Texture2DTrilinearFilter("textures/sun/sun_small1.png")); GLRenderInfo renderInfo = new GLRenderInfo(SunShader.getInstance(), new AlphaBlendingSrcAlpha(), buffer); addComponent(NodeComponentType.MAIN_RENDERINFO, renderInfo); addComponent(NodeComponentType.MATERIAL0, material1); addComponent(NodeComponentType.MATERIAL1, material2); Light light = new Light(); light.setOcclusionQuery(new GLOcclusionQuery()); addComponent(NodeComponentType.LIGHT, light); LightHandler.getLights().add(light); }
GLRenderInfo wireframeRenderInfo = new GLRenderInfo(wireframeShader, renderConfig, meshBuffer); dudv = new Texture2DTrilinearFilter("textures/water/dudv/dudv1.jpg"); caustics = new Texture2DTrilinearFilter("textures/water/caustics/caustics.jpg");