First example doesn't work

I simply downloaded the latest (beta 3) JDK and tried copying and pasting the code for HelloJME3 for the first tutorial.



However, when I run the file, it seems to open the window and displays the debug console thing in the bottom left corner, but nothing actually shows up, and also, this message occurs (although I am clueless as to whether it is causing the problem in this case):



[java]INFO: Uniform m_VertexColor is not declared in shader [ShaderSource[name=Common/MatDefs/Misc/Unshaded.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Misc/Unshaded.frag, defines, type=Fragment]].[/java]



Any information pertaining to solving this problem, or helping me through this would be greatly appreciated! :smiley:

This is no problem, just an obsolete warning? Did you care to read what the first exaple is supposed to show? :roll:

Well to be honest, when it says (in the comments):

Display a blue 3D cube and view from all sides by moving the mouse and pressing the WASD keys.
,
and nothing is being displayed, then I would consider that an issue...

What is “the debug console thing”? You mean the FPS display? If nothing is showing in the main window I guess your graphics card isn’t working properly, try updating the drivers (after making sure you actually used an unlit material).

Or coming at it another way to eliminate a bunch of things that might have gone wrong…



Do the JME tests work?

I recently updated my drivers to the latest version (ATi 11.11 preview drivers for my 6850 cards running Crossfire), and dabbling around with OpenGL, and more specifically JOGL through NetBeans earlier today, I was able to render shapes and my graphics card performed its functionally perfectly well. It’s just in this instance, the code compiles perfectly fine, but when I come to test the class it shows the FPS Counter in the lower left corner of the window but then all there is in the background is a black scene.



From this information provided, I severely doubt that my “graphics card isn’t working properly” is the reason for this issue. :confused:



Also, I would expect that a pure copy and paste of the code as stated in the tutorial into a new class would work without editing as it doesn’t specify the need to alter the code in any way. Very strange.

@pspeed said:
Or coming at it another way to eliminate a bunch of things that might have gone wrong...

Do the JME tests work?


It would seem so which is why I find it odd, although naturally, I haven't tested every single JME test as there are quite a few, but ones with basic camera control such as cinematic tracking and so on, I have tested, and a teapot and grid were rendered and the keyboard/ mouse events worked. I also tested ones such as the water rendering. So yes, I am confused as to why this first tutorial program will not function as expected :/.

It sounds like the tutorial may be broken. Can you provide the link you used?



I’m assuming you cut and pasted it directly without any modifications but I’m not familiar with all of the different tutorial links and anyway it’s good to make sure we are looking at the same one.

Yes, no problem.



This is the tutorial I have been referring to:

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_simpleapplication

OK. Strange new information. It would appear now that for pretty much any test that I run within JME tests, that the program causes my AMD Drivers to crash and/or a Java program not responding error. Why oh why is this occurring now =[?

Ok, now your info message makes no sense either since no where in that code is “m_VertexColor” mentioned… and I’m pretty sure JME has no reason to be calling it.



You’re sure that’s the code you are using? Very strange.



Regarding your crashes, make sure your drivers are up to date. You probably already have but ATI (which is now AMD with baggage) used to really really suck at OpenGL… and only recently has this improved… and still improving. So extra super important to have driver upgrades.

  1. Yes, the code I use is a straightforward copy and paste.
  2. Yes, my drivers are up to date both by referencing the version number with the websites latest release, and by using the “Check for Updates” option in Catalyst Control Centre.



    I feel I’m destined to not be able to use JME…

A smarter monkey than I am will have to explain why this code:

[java]

package jme3test.helloworld;



import com.jme3.app.SimpleApplication;

import com.jme3.material.Material;

import com.jme3.math.Vector3f;

import com.jme3.scene.Geometry;

import com.jme3.scene.shape.Box;

import com.jme3.math.ColorRGBA;



/** Sample 1 - how to get started with the most simple JME 3 application.

  • Display a blue 3D cube and view from all sides by
  • moving the mouse and pressing the WASD keys. */

    public class HelloJME3 extends SimpleApplication {



    public static void main(String[] args){

    HelloJME3 app = new HelloJME3();

    app.start(); // start the game

    }



    @Override

    public void simpleInitApp() {

    Box b = new Box(Vector3f.ZERO, 1, 1, 1); // create cube shape at the origin

    Geometry geom = new Geometry(“Box”, b); // create cube geometry from the shape

    Material mat = new Material(assetManager,

    “Common/MatDefs/Misc/Unshaded.j3md”); // create a simple material

    mat.setColor(“Color”, ColorRGBA.Blue); // set color of material to blue

    geom.setMaterial(mat); // set the cube’s material

    rootNode.attachChild(geom); // make the cube appear in the scene

    }

    }[/java]



    Causes this INFO message:

    [java]

    INFO: Uniform m_VertexColor is not declared in shader [ShaderSource[name=Common/MatDefs/Misc/Unshaded.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Misc/Unshaded.frag, defines, type=Fragment]].

    [/java]



    The code I’ve pasted above looks legit to me… though I haven’t tested it.



    What do the rest of your logs/console say? It should dump the info about your graphics card also.

OK, when I run the above code in your previous post, the dump in the console is as such:



[java]run:

Nov 29, 2011 10:39:40 PM com.jme3.system.JmeSystem initialize

INFO: Running on jMonkeyEngine 3.0.0 Beta

Nov 29, 2011 10:39:40 PM com.jme3.system.Natives extractNativeLibs

INFO: Extraction Directory: C:UsersPhilDocumentsGamesMy Created GamesHelloWorldApplication

Nov 29, 2011 10:39:40 PM com.jme3.system.lwjgl.LwjglAbstractDisplay run

INFO: Using LWJGL 2.8.2

Nov 29, 2011 10:39:40 PM com.jme3.system.lwjgl.LwjglDisplay createContext

INFO: Selected display mode: 640 x 480 x 0 @0Hz

Nov 29, 2011 10:39:40 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo

INFO: Adapter: aticfx64

Nov 29, 2011 10:39:40 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo

INFO: Driver Version: 8.17.10.1103

Nov 29, 2011 10:39:40 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo

INFO: Vendor: ATI Technologies Inc.

Nov 29, 2011 10:39:40 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo

INFO: OpenGL Version: 4.1.11251 Compatibility Profile Context

Nov 29, 2011 10:39:40 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo

INFO: Renderer: AMD Radeon HD 6800 Series

Nov 29, 2011 10:39:40 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo

INFO: GLSL Ver: 4.10

Nov 29, 2011 10:39:40 PM com.jme3.system.lwjgl.LwjglTimer <init>

INFO: Timer resolution: 1,000 ticks per second

Nov 29, 2011 10:39:40 PM com.jme3.renderer.lwjgl.LwjglRenderer initialize

INFO: Caps: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample, TextureMultisample, OpenGL20, OpenGL21, OpenGL30, OpenGL31, OpenGL32, ARBprogram, GLSL100, GLSL110, GLSL120, GLSL130, GLSL140, GLSL150, VertexTextureFetch, TextureArray, TextureBuffer, FloatTexture, FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, PackedFloatColorBuffer, TextureCompressionLATC, NonPowerOfTwoTextures, MeshInstancing, VertexBufferArray]

Nov 29, 2011 10:39:40 PM com.jme3.asset.DesktopAssetManager <init>

INFO: DesktopAssetManager created.

Nov 29, 2011 10:39:40 PM com.jme3.renderer.Camera <init>

INFO: Camera created (W: 640, H: 480)

Nov 29, 2011 10:39:40 PM com.jme3.renderer.Camera <init>

INFO: Camera created (W: 640, H: 480)

Nov 29, 2011 10:39:40 PM com.jme3.input.lwjgl.LwjglMouseInput initialize

INFO: Mouse created.

Nov 29, 2011 10:39:40 PM com.jme3.input.lwjgl.LwjglKeyInput initialize

INFO: Keyboard created.

Nov 29, 2011 10:39:40 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread

INFO: AudioRenderer supports 64 channels

Nov 29, 2011 10:39:40 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread

INFO: Audio effect extension version: 1.0

Nov 29, 2011 10:39:40 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread

INFO: Audio max auxilary sends: 4

Nov 29, 2011 10:39:40 PM com.jme3.material.MaterialDef <init>

INFO: Loaded material definition: Unshaded

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Gui Node)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (Statistics View) attached to this node (Gui Node)

Nov 29, 2011 10:39:41 PM com.jme3.scene.Node attachChild

INFO: Child (Box) attached to this node (Root Node)

Nov 29, 2011 10:39:41 PM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation

INFO: Uniform m_VertexColor is not declared in shader [ShaderSource[name=Common/MatDefs/Misc/Unshaded.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Misc/Unshaded.frag, defines, type=Fragment]].

Nov 29, 2011 10:39:46 PM com.jme3.renderer.lwjgl.LwjglRenderer cleanup

INFO: Deleting objects and invalidating state

Nov 29, 2011 10:39:46 PM com.jme3.input.lwjgl.LwjglMouseInput destroy

INFO: Mouse destroyed.

Nov 29, 2011 10:39:46 PM com.jme3.input.lwjgl.LwjglKeyInput destroy

INFO: Keyboard destroyed.

Nov 29, 2011 10:39:46 PM com.jme3.system.lwjgl.LwjglAbstractDisplay deinitInThread

INFO: Display destroyed.

BUILD SUCCESSFUL (total time: 7 seconds)[/java]

I’m out of ideas. Hopefully someone else sees something I don’t. If I have time, I may try to run it myself but the code looks good to me.

Yeah I am generally confused now.



All of the tutorials seem to not work for this “m_VertexColor” issue…

(For example, the 2nd tutorial in which 2 cubes are drawn, one blue in colour, one red in colour, comes up with the “m_VertexColour is not declated” INFO line but still draws the blue cube. However, the red cube is not drawn.)



I really hope this one gets solved, I want to get into learning to use JME so much =[

@sonico11 said:
All of the tutorials seem to not work for this "m_VertexColor" issue...

Again, this is _not_ the issue.
@normen said:
Again, this is _not_ the issue.


And to be clear, I agree with normen that this is not itself an issue. It just looked strange to me and I wanted to make sure the code being run was the code stated.

To me, the info line is a bug but only because it's basically useless information. It won't cause any problems.

Sorry that I keep referring to this as an “issue”…



I suppose it would be more apt of me to say discrepancy. Anybody still have any ideas as to why this cube in the first example won’t render, and the red cube in the second?



(That’s HelloJME3.java and HelloNode.java respectively…)

Right - had a brainwave to try to run the examples with Crossfire disabled (aka run just my main GPU) and low and behold, it works.



I don’t know whether this a driver problem or not but I’ll keep people informed in case anyone else has the same problem as me (as in not rendering, I recognise that INFO line as a bug somewhat now)…