jPCT-AE - a 3d engine for Android > Support

Need info for using bump image texture

(1/2) > >>

Gopinath:
Hi,

From the docs and searches done, I understand that the applying bump image texture for 3D model using JPCT is not possible. Is there any update on how this can be done. Incase if there is any other method where the bump image can be applied apart from the texture to an object, pls share the same.

EgonOlsen:
Of course it's possible. It's just not that the engine itself provides a special class to do it. You can use a shader for it, the HelloShader example that comes with the engine does an advanced kind of bump mapping called parallax mapping. Maybe that helps as a starting point.

Gopinath:
Thank you EgonOlsen. But I had referred to the HelloShader sample. It uses face_height2.png which I do not have such a blur image with me from client. I only have the regular jpg texture image and the blue colored bump image.

So i have tried with TextureInfo and added both the textures to it and applied to the object. But I could not see any improvement on it.

ti = new TextureInfo(TextureManager.getInstance().getTextureID("texture0"));
ti.add(TextureManager.getInstance().getTextureID("bump_tex"), TextureInfo.MODE_BLEND);

I have included the GLSLShader code by copying the fragment and vertex files from HelloShader example to my project.

shader = new GLSLShader(Loader.loadTextFile(this.getAssets().open("vertexshader_offset.glsl")), Loader.loadTextFile(this.getAssets().open("fragmentshader_offset.glsl")));

temp.setTexture(ti);
temp.setShader(shader);
shader.setStaticUniform("invRadius", 0.0003f);

EgonOlsen:
Without the height map, the shader will actually create "normal" normal mapping (which a little overhead, but that might not matter in this case). I'm not sure why it doesn't work for you...can you post a screen shot and the textures?

Gopinath:
I tried considering the bump image texture for height. But still no gain. I have attached the bump texture for your reference. As there is size restriction of 64 kb, i could not upload full image, but now have cropped a small portion of it for reference.

Do I need to get the height map image from my client or can we create it from regular texture or bump image.

[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

Go to full version