That code looks fine, the error lies somewhere else
Ok got the chance to test it on my home pc and it works perfectly. 144 fps stable. My tower has an amd cpu and Nvidia 660 gpu.
It works and looks great on my home computer which has a GTX680, got about 114 fps at the beginning of the scene.
However it failed to launch on my work computer which has a Intel HD 4600, I tried to update the driver but still no luck, here is the message:
C:\Users\pan\Downloads\TestFPS\TestFPS>java -jar client.jar
.......................................
... Initializing Rendering Pipeline ...
.......................................
Exception in thread "main" java.lang.IllegalStateException: Function is not supported
at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:58)
at org.lwjgl.opengl.ARBDebugOutput.glDebugMessageCallbackARB(ARBDebugOutput.java:104)
at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:138)
at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:126)
at tests.fps.TestFPS.main(TestFPS.java:124)
C:\Users\pan\Downloads\TestFPS\TestFPS>pause
Press any key to continue . . .
This one is actually my fault!
I wanted to check if I was doing any illegal openGL calls (trying to fix EgonOlson’s issue). In doing so I had to create a debug callback, and I forgot that those only work on OpenGL 4+.
I removed the callback and reuploaded the file. Hopefully it will run on your work computer now ^^
I also changed all of the physics sounds. And I added a “hard” and “soft” sound for each rigid body.
[Edit]
I showed this to my friend, and he couldn’t believe that this was java
Hmm, getting this when I try to run it:
.......................................
... Initializing Rendering Pipeline ...
.......................................
.......... Creating Shaders ...........
......... Setting Up Camera ...........
..... Setting Up Lighting Engine ......
Detected NVIDIA card.
Vendor: nvidia corporation
Renderer: geforce gtx 670/pcie/sse2
Exception in thread "main" java.lang.NullPointerException
at engine.rendering.gl.texture.SkyBox.<init>(SkyBox.java:38)
at engine.rendering.RenderingPipeline.initialize_lighting_engine(RenderingPipeline.java:204)
at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:180)
at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:126)
at tests.fps.TestFPS.main(TestFPS.java:124)
Did you extract the game? ???
The skybox is just a standard buffered image loading thing.
Yes, it’s extracted. It worked fine when I ran it on another computer, though. The computer with the issue is running Linux while the other is running Windows, so maybe that
has something to do with it?
Maybe ¯_(ツ)_/¯
[quote]I removed the callback and reuploaded the file. Hopefully it will run on your work computer now ^^
[/quote]
Yeap it now works happily on my desktop at work
Good job on the physics engine, it feels very realistic.
I’ll give it a go at home on a more recent AMD card and report back…
It works on my AMD 290x, albeit it still logs some error message (I think you can ignore the REX prefix thing at the end…I’m getting this too in my stuff…no idea where it actually comes from, but it doesn’t seem to hurt):
.......................................
... Initializing Rendering Pipeline ...
.......................................
.......... Creating Shaders ...........
......... Setting Up Camera ...........
..... Setting Up Lighting Engine ......
Error occured: An OpenGL error was already present when the new LightingEngine object was created.: Invalid enum
Detected ATI card, enabling depth-stencil workaround.
Vendor: ati technologies inc.
Renderer: amd radeon r9 200 series
....... Initializing resources ........
........ Setting up Game Logic ........
OpenAL initialized.
[0x7FFEABEB4450] ANOMALY: meaningless REX prefix used
Done!
I am not sure what is causing the enum error. It only happens on some GPUs and only some OS’s; there’s no correlation. It’s probably both a driver thing, and something illegal that I am doing. It doesn’t seem to be affecting anything at the moment, but I will keep looking for it
I posted this on the reddit gamedev section, and got some good feedback there. There was a problem with my timestep, and both the physics simulation and player movement were not consistent with framerates. I spent the day fixing that
I also added some animations/sounds to the gun for fun ^^
It’s really, really nice. In terms of frame rate it was flawless even in a scene with lots of boxes, barrels and lights. Looked great with FXAA and SSAO enabled. But I did notice that after a while of spawning lots of things in, the movement became especially jerky, but the FPS did not suffer.
I released an update just now.
A lot of little things have been tweaked internally. There’s also some more commands in the console and a new map
Also, when you first launch the game, a file called “RenderSettings.cfg” is created. This is a list of all the rendering variables and their values. If you change these values they will be loaded in at next launch!
To load a map, type:
map path/filename.ext
To load the new map:
map map2/world.mm3d
Works fine for me 144 FPS, 200 TPS. Only thing i would say is that when i clicked of the screen the player continues to rotate in the game even when the mouse has left the aplication
I still can’t open the ingame console … what about putting it on the F10/11/12 key or something ;D
.......................................
... Initializing Rendering Pipeline ...
.......................................
.......... Creating Shaders ...........
......... Setting Up Camera ...........
..... Setting Up Lighting Engine ......
Detected NVIDIA card.
Vendor: nvidia corporation
Renderer: geforce gtx 960/pcie/sse2
....... Initializing resources ........
........ Setting up Game Logic ........
OpenAL initialized.
WARNING: class java.io.IOException when attempting to read image: res/models/bar
rel/RedBarrel_D.png
WARNING: class java.io.IOException when attempting to read image: res/models/ump
/NULL
Done!
You might need some code to seperate stuck phys-objects:
They are making sweet sweet love with that wall.
The tps is low because i spawned some barrels and boxes already.
It would make the game much smoother if you split physics and movement update-rate completely,
there are some jerks now and then, making the movement/looking feel awkward.
Awesome work! Animations, Sound and Graphics work nicely!
~/Downloads/TestFPS: java -jar ./client.jar
…
… Initializing Rendering Pipeline …
…
… Creating Shaders …
… Setting Up Camera …
… Setting Up Lighting Engine …
Error occured: An OpenGL error was already present when the new LightingEngine object was created.: Invalid enum
Detected Intel card.
Vendor: intel open source technology center
Renderer: mesa dri intel® haswell mobile
WARNING: class java.io.IOException when attempting to read image: res/textures/skybox.png
Hi helioscat! Thanks for trying the engine!
Are you on linux? I’ve noticed a few linux people are having that same issue when running the game. I’ve made a “fallback” if it cannot load the images properly, so please redownload and let me know if it works!
I’ve updated a few things in the past few days…
- The image loading fallback (listed above)
- Console can be opened with ~ or F12
- I added a decal system
- I added a particle system
- The gun now shoots properly. It create bullet holes and interacts with rigid bodies in the scene
- I created a new test level to test multiple material sounds
[EDIT]
I released a small update again today. I changed the skybox so that it could support bright textures ( I.E. a sun ).
Hello orange451 nice to test your lighting FPS. And now the error is
or:
./run.sh
.......................................
... Initializing Rendering Pipeline ...
.......................................
.......... Creating Shaders ...........
......... Setting Up Camera ...........
..... Setting Up Lighting Engine ......
Error occured: An OpenGL error was already present when the new LightingEngine object was created.: Invalid enum
Detected Intel card.
Vendor: intel open source technology center
Renderer: mesa dri intel(r) haswell mobile
WARNING: class java.io.IOException when attempting to read image: res/textures/skybox.png
javax.swing.UnsupportedLookAndFeelException: [The Microsoft Windows Look and Feel - com.sun.java.swing.plaf.windows.WindowsLookAndFeel] not supported on this platform
at javax.swing.UIManager.setLookAndFeel(UIManager.java:526)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:583)
at engine.error.ErrorFrame.<init>(ErrorFrame.java:17)
at engine.rendering.RenderingPipeline.error(RenderingPipeline.java:261)
at engine.rendering.RenderingPipeline.initialize_lighting_engine(RenderingPipeline.java:252)
at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:205)
at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:144)
at tests.fps.TestFPS.main(TestFPS.java:150)
“Script” for just in case
~/Downloads/TestFPS: cat ./run.sh
#!/bin/sh
java -jar ./client.jar
That error is the same as before :(! It’s just I made it so it creates a dialogue letting you know the lighting engine failed to initialize; the UIManager error (javax.swing.UnsupportedLookAndFeelException) is unrelated.
However, it is still unable to load the skybox…
In your res folder, there is a skybox.png correct?
Is it skybox.png or skybox.PNG? This is super weird… I am using the built-in ImageIcon class that’s part of Java to load the image :x
[EDIT]
I have reworked the fallback code. I fear it may have not been running! Please redownload :point:
On a side note, I put in the latest nightly build of LWJGL 2 (2.9.4). It seems as though Spasi has fixed the mouse stuttering issues! ^^