IsoSurface Demo - Dev blog experiment... (released)

This is the Type-enum from the trunk:

/** * Type of buffer. Specifies the actual attribute it defines. */ public static enum Type { /** * Position of the vertex (3 floats) */ Position,
    /**
     * The size of the point when using point buffers (float).
     */
    Size,

    /**
     * Normal vector, normalized (3 floats).
     */
    Normal,

    /**
     * Texture coordinate (2 float)
     */
    TexCoord,

    /**
     * Color and Alpha (4 floats)
     */
    Color,

    /**
     * Tangent vector, normalized (4 floats) (x,y,z,w)
     * the w component is called the binormal parity, is not normalized and is either 1f or -1f
     * It's used to compuste the direction on the binormal verctor on the GPU at render time.
     */
    Tangent,

    /**
     * Binormal vector, normalized (3 floats, optional)
     */
    Binormal,

    /**
     * Specifies the source data for various vertex buffers
     * when interleaving is used. By default the format is
     * byte.
     */
    InterleavedData,

    /**
     * Do not use.
     */
    @Deprecated
    MiscAttrib,

    /**
     * Specifies the index buffer, must contain integer data
     * (ubyte, ushort, or uint).
     */
    Index,

    /** 
     * Initial vertex position, used with animation.
     * Should have the same format and size as {@link Type#Position}.
     * If used with software skinning, the usage should be 
     * {@link Usage#CpuOnly}, and the buffer should be allocated
     * on the heap.
     */
    BindPosePosition,

    /** 
     * Initial vertex normals, used with animation.
     * Should have the same format and size as {@link Type#Normal}.
     * If used with software skinning, the usage should be 
     * {@link Usage#CpuOnly}, and the buffer should be allocated
     * on the heap.
     */
    BindPoseNormal,      
     
    /** 
     * Bone weights, used with animation (4 floats).
     * Only used for software skinning, the usage should be 
     * {@link Usage#CpuOnly}, and the buffer should be allocated
     * on the heap.
     */
    BoneWeight,

    /** 
     * Bone indices, used with animation (4 ubytes).
     * Only used for software skinning, the usage should be 
     * {@link Usage#CpuOnly}, and the buffer should be allocated
     * on the heap as a ubytes buffer.
     */
    BoneIndex,

    /**
     * Texture coordinate #2
     */
    TexCoord2,

    /**
     * Texture coordinate #3
     */
    TexCoord3,

    /**
     * Texture coordinate #4
     */
    TexCoord4,

    /**
     * Texture coordinate #5
     */
    TexCoord5,

    /**
     * Texture coordinate #6
     */
    TexCoord6,

    /**
     * Texture coordinate #7
     */
    TexCoord7,

    /**
     * Texture coordinate #8
     */
    TexCoord8,
    
    /** 
     * Initial vertex tangents, used with animation.
     * Should have the same format and size as {@link Type#Tangent}.
     * If used with software skinning, the usage should be 
     * {@link Usage#CpuOnly}, and the buffer should be allocated
     * on the heap.
     */
    BindPoseTangent,
    
    /** 
     * Bone weights, used with animation (4 floats).
     * for Hardware Skinning only
     */
    HWBoneWeight,

    /** 
     * Bone indices, used with animation (4 ubytes).
     * for Hardware Skinning only
     * either an int or float buffer due to shader attribute types restrictions.
     */
    HWBoneIndex,
}

from: VertexBuffer.java

Am I looking the wrong place ?

@asser.fahrenholz said: This is the Type-enum from the trunk:

from: VertexBuffer.java

Am I looking the wrong place ?

Most certainly. Maybe you are still building from JME SVN? It’s really old now.

Note the big giant message on this page:
https://code.google.com/p/jmonkeyengine/

@pspeed said: Note the big giant message on this page: https://code.google.com/p/jmonkeyengine/

Hah. Thanks. I somehow assumed that the two repositories were sync’ed - anyways. Thanks - i’ll try my luck with checking out from Git.

@asser.fahrenholz said: Hah. Thanks. I somehow assumed that the two repositories were sync'ed - anyways. Thanks - i'll try my luck with checking out from Git.

Note: you can use SVN to check things out from github and it works just fine. :slight_smile:

Awesome! I think i will use your marching cubes implementation on my voxel based terrain.

By the way at MarchingCubesMeshGenerator.java row 97, isn’t suppose to be
this.cells = new int[cx* cy * cz];
instead of
this.cells = new int[cy* cy * cz];

?

@Riccardo said: Awesome! I think i will use your marching cubes implementation on my voxel based terrain.

By the way at MarchingCubesMeshGenerator.java row 97, isn’t suppose to be
this.cells = new int[cx* cy * cz];
instead of
this.cells = new int[cy* cy * cz];

?

Yes, probably. :slight_smile: I’ll fix it.

@Riccardo said: Awesome! I think i will use your marching cubes implementation on my voxel based terrain.

By the way at MarchingCubesMeshGenerator.java row 97, isn’t suppose to be
this.cells = new int[cx* cy * cz];
instead of
this.cells = new int[cy* cy * cz];

?

Fix committed. Forgot to credit you… sorry.

Thanks for the patch, though.

Hi,

I’m checked out the IsoSurface Demo and downloaded the jinput.jar-files, and the lwjgl-platform-2.9.0-natives from java2s.com, when I try to run the project from jmonkeyengine SDK, the settings window comes up fine, but when I press start, nothing happens…the game runs for a while (the sdk shows it as running) and then it exits.

Any idea as to where to look ?

@asser.fahrenholz said: Hi,

I’m checked out the IsoSurface Demo and downloaded the jinput.jar-files, and the lwjgl-platform-2.9.0-natives from java2s.com, when I try to run the project from jmonkeyengine SDK, the settings window comes up fine, but when I press start, nothing happens…the game runs for a while (the sdk shows it as running) and then it exits.

Any idea as to where to look ?

Well, first, you shouldn’t have had to download any of jinput or lwjgl natives. That’s a sign that things weren’t setup right.

As to the other, if you didn’t get an error on the SDK console then I don’t know what to say… but it sounds like your project is setup strangely… so I don’t know.

Well, I basically checked out the project and a whole bunch of libs were missing (when running it from the sdk). I’ll try a gain and update you as to what the SDK is reporting.

@asser.fahrenholz said: Well, I basically checked out the project and a whole bunch of libs were missing (when running it from the sdk). I'll try a gain and update you as to what the SDK is reporting.

I think the version that’s checked in right now depends on JME trunk and so you have to point it to the place where you built the JME libs. You should also have the entire simsilica-tools tree checked out and probably Lemur and Lemur-props as well. Or download the jars and point to them.

Edit: or you may be able to point to the various jars in the IsoSurfaceDemo zips lib directory. At least temporarily.

This is what I get when I first check it out : http://imgur.com/WwKFfnJ

The Arboreal/SimFx/Lemur/LemurProps/jme3-jars I can find by linking to projects/trunk jme - but the jinput/lwjgl-jars are missing. I’ll try copying them from the dist/libs to a sub dir and using them.

Your JME checkout must be messed up. jinput, etc. should all be right there in dist/libs with everything else. Recheck it out from github and “gradle dist” it again. Sometimes twice.

Ah thanks. I’m not fully up to speed on where all the libs can be found when checking out etc. That helped a ton.

Now, the error I get is this:

com.jme3.asset.AssetNotFoundException: MatDefs/TreeLighting.j3md at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:283) at com.jme3.material.Material.read(Material.java:1228) at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:344) at com.jme3.export.binary.BinaryInputCapsule.readSavable(BinaryInputCapsule.java:457) at com.jme3.scene.Geometry.read(Geometry.java:565) at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:344) at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:483) at com.jme3.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:471) at com.jme3.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:587) at com.jme3.scene.Node.read(Node.java:598) at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:344) at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:483) at com.jme3.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:471) at com.jme3.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:587) at com.jme3.scene.Node.read(Node.java:598) at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:344) at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:242) at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:125) at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:109) at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:288) at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:374) at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:378) at com.simsilica.iso.demo.TerrainState.initialize(TerrainState.java:322)

Am I missing an asset project? I resolved all the reference problems as pictured in the link I presented above.

That indicates that you are missing arboreal-assets.jar.

Thank you. Got it working now. The arboreal-assets.jar I was using was outdated it seems - didn’t have the TreeLighting-files included.

A question: Is there any way to set the smoothness of the terrain ?

@asser.fahrenholz said: A question: Is there any way to set the smoothness of the terrain ?

Depends on what you mean by smoothness. You can mess around with the fractal code… pretty much the only way to change the terrain.

I’m very interested in this project and tried to build IsoSurfaceDemo and dependencies from scratch, but I’ve gotten an error that looks like a bug in LemurProps. I should note clearly that I can build it just fine when I link to the default version of LemurProps in the IsoSurfaceDemo trunk so this isn’t a huge priority, just a note.

To set a baseline, I’ve built against the latest jme trunk from git, and I’ve also built the latest Lemur (which runs fine and I can link and build into IsoSurfaceDemo successfully). When I try to build and use the latest LemurProps I have the following error in the source ‘PropertyPanel.java’ at the top:

[java]
PropertyPanel is not abstract and does not override abstract method GetObject() in VersionedObject

the error line is:
public class PropertyPanel extends Panel
implements VersionedObject<PropertyPanel> {
[/java]

There are also numerous other errors such as the absence of ‘getControl’ as a method. Basically it looks as though the definition of VersionedObject differs from the one that PropertyPanel is expecting. Perhaps the code is in mid-flight?

Regards,
Shane