LWJGL - OpenGl 4.2 (core) Planets simulator

Started by juemisorg, September 29, 2012, 14:00:05

Previous topic - Next topic

juemisorg

Hi everyone.

First, sorry for my poor english but I'm french

This is my full OpenGL4.2 compliant planet simulator. It does :
- Full openGL 4.2 (core, no compatibility function is used) with LWJGL 2.8.4
- MultiThreaded Planet simulator (Newton's equations)
- Texturing
- Instancing is used for planet drawing
- Text drawing with texture atlas
- GLSL 4.2
- VAO + VBO
- Java 7
- OBJ loader
- Texture loader
- Correctly documented (in french: easy to understand)
- Code easily understandable by beginners
- few class, few code, no inused function ...

The executable jar https://mega.co.nz/#!PkR3CRaQ!GpUGCEx6oOZpatM7eEe3dTo_eHViIxgaVNVk8wILxUE
The eclipse project : https://mega.co.nz/#!q8AUlRSQ!d45i3xGyTfivfP3ENH8utQneDPg6Zi3GrIHJbSIUs5k


Please, give me your feedback : bugs, no oriended object or Opengl compliant aspects...

Thanks for all.

CodeBunny


Cubic

Quote
- Correctly documented (in french: easy to understand)

You should try to always write your documentation (including your source comments) in english (nothing stops you from writing a french co-doc). You seem to be capable of speaking english quite okay, while I speak barely enough french to tell you that I barely speak any french and to ask you to speak english please. And I think I'm still above world-average with that.

Evil-Devil

I am pretty lazy for searching in applications i downloaded...your app starts and directly close down.

QuoteC:\Dokumente und Einstellungen\Evil-Devil\Eigene Dateien\Executable>java -jar O.
G.N.S.jar
Main.initDisplay : 4.2.11762 Core Profile Context ok
Main.initOpenGL : ok
Shader.loadFromFile : vTexture.vert
Vertex shader was successfully compiled to run on hardware.

I wonder why.

juemisorg

Hi.

sorry if it does not work. This is my log :

Quote
D:\A classer\Executable>java -jar O.G.N.S.jar
Main.initDisplay : 4.2.0 ok
Main.initOpenGL : ok
Shader.loadFromFile : vTexture.vert ok
Shader.loadFromFile : fTexture.frag ok
ShaderTexture.ShaderTexture : ok
Shader.loadFromFile : vTextureInstance.vert ok
Shader.loadFromFile : fTexture.frag ok
ShaderTexture.ShaderTexture : ok
Shader.loadFromFile : vTextureInstance.vert ok
Shader.loadFromFile : fTexture.frag ok
ShaderTexture.ShaderTexture : ok
Shader.loadFromFile : vTextureInstance.vert ok
Shader.loadFromFile : fTexture.frag ok
ShaderTexture.ShaderTexture : ok
Main.initShaders : ok
Objet.loadFromObj : Sphere.obj : 151 pts - 224 faces
Objet.createBuffer ID 1 : ok
Texture.loadFromImage : Soleil.jpg 256 128 false ok
Objet.loadFromObj : Sphere.obj : 151 pts - 224 faces
Objet.createBuffer ID 2 : ok
Texture.loadFromImage : AsteroideGris.jpg 256 128 false ok
Objet.loadFromObj : Sphere.obj : 151 pts - 224 faces
Objet.createBuffer ID 3 : ok
Texture.loadFromImage : Terre.png 512 256 true ok
Objet.loadFromObj : Sphere.obj : 151 pts - 224 faces
Objet.createBuffer ID 4 : ok
Texture.loadFromImage : Jupiter.png 1024 512 false ok
Main.initObjets : ok
Fonte.lireXml : OK
Texture.loadFromImage : Verdana18.png 256 256 true ok
Shader.loadFromFile : vTexte.vert ok
Shader.loadFromFile : fTexte.frag ok
ShaderText.ShaderText : ok
Fonte.createBuffer ok
Main.initFonte : ok
Main.initPlanetes : ok

DurÚe totale d'ÚxÚcution            : 18087.463 ms
DurÚe moyenne d'ÚxÚcution par image : 0.45028412 ms - 2220.82 fps
DurÚe totale gravitation            : 1.933772 ms
DurÚe moyenne gravitation par image : 4.8140904E-5 ms - 2.0772356E7 fps
DurÚe totale OpenGL                 : 11138.746 ms
DurÚe moyenne OpenGL par image      : 0.27729708 ms - 3606.2407 fps

Shader.delete ID 3 : ok
Shader.delete ID 6 : ok
Shader.delete ID 9 : ok
Shader.delete ID 12 : ok
Objet.delete ID 1 : ok
Objet.delete ID 2 : ok
Objet.delete ID 3 : ok
Objet.delete ID 4 : ok
Shader.delete ID 15 : ok
Fonte.delete :  ok
Main.delete : ok

I don't undersand why you're initDisplay version is 4.2.11768 and not 4.2.0.
Are you on a 32 or 64 bit system ? I just tested on a 64 bit system.
What is you're java version ?

I really want to help you.

Thank's


Evil-Devil

Nothing special.

WinXP 32bit SP3
ATI Radeon HD6950 (2GB)
Catalyst 12.8


//edit: made it...
// Cherche si des erreurs
int logLength = glGetShader(shaderID, GL_INFO_LOG_LENGTH);
if (logLength > 0) {
	String err = glGetShaderInfoLog(shaderID, logLength);
	if (err.trim().length() > 0) {
		
		System.out.println(NOM_FONCTION + _fichier + "\n" + err);
		System.exit(-1);
	}
}
System.out.println(NOM_FONCTION + _fichier + " ok");

in Shader.java.

When i comment the conditional your application works fine.
So you should not rely on the info log. Check the shader/program status too.


//edit 2:

your fps counter seem to be broken.

initial >1k fps

@10k planets, 50threads
~300fps
displayed at 1080p