Hi,
Parallax Bump is available only for procedural models? I have some problems with FloatBuffer which can not be set to Node (no setTextureBuffer() method in Node).
Can i use Parallax Bump on Node? If so, please show me the way.
setTextureBuffer() doesn't make sense in Node, since Node doesn't contain triangle information, but other Spatials. Go down the classpath hierarchy to find the TriMeshes containing the visible geometry for your model, and set their texture coordinates instead.
Yes… works:) Thanks for the tip.
Well… not quite. I have this error when i trying to load some objects:
java.lang.IllegalArgumentException
at java.nio.Buffer.limit(Unknown Source)
at com.jme.renderer.lwjgl.LWJGLRenderer.predrawGeometry(Unknown Source)
at com.jme.renderer.lwjgl.LWJGLRenderer.draw(Unknown Source)
at com.jme.scene.batch.TriangleBatch.draw(Unknown Source)
at com.jme.scene.TriMesh.draw(Unknown Source)
at com.jme.scene.Spatial.onDraw(Unknown Source)
at com.jme.scene.Node.draw(Unknown Source)
at com.jme.scene.Spatial.onDraw(Unknown Source)
at com.jme.scene.Node.draw(Unknown Source)
at com.jme.scene.Spatial.onDraw(Unknown Source)
at com.jme.renderer.lwjgl.LWJGLRenderer.draw(Unknown Source)
at com.jme.app.SimpleGame.render(Unknown Source)
at com.jme.app.BaseGame.start(Unknown Source)
at TestMaxJmeWrite.main(TestMaxJmeWrite.java:50)
I'm using this code:
for (Spatial s: mynode.getChildren()){
if (s instanceof TriMesh){
TriMesh mesh = (TriMesh) s;
mesh.setTextureBuffer(0, tex11, 1);
mesh.setTextureBuffer(0, tex12, 2);
}
}
What i'm doing wrong? Still i can not use parallax mapping on 3ds models...
ur buffer is not big enough haha.
r u using createVector2fBuffer(4)?
change that number 4 to the number of vertices u have on the model * 2.