Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » Applications created with U++ » UltimateOpenGL [BETA] 3D engine (A 3D engine to make game)
Re: UltimateOpenGL [BETA] 3D Engine [message #52763 is a reply to message #52758] Tue, 19 November 2019 21:43 Go to previous messageGo to previous message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
koldo wrote on Tue, 19 November 2019 08:10
Hello Klugier

UltimateOpenGL would be a great new part of Bazaar, and I invite Xemuth to include it there, giving my personal support if needed.

GitHub is very interesting, and my main personal project, BEMRosetta, is there. However I cannot include BEMRosetta in Upp Bazaar becasue I have released it with GPLv3. However Xemuth has released UltimateOpenGL in a BSD like license so it would fit perfectly in Bazaar.

In addition, the advantage of Bazaar over GitHub, especially in projects like UltimateOpenGL, is that the developer can match sources and dependencies so well that it is very easy for a new developer to run a sample. When in GitHub, a new developer has to arrange it all by hand, and UltimateOpenGL include at least GLM, Glad, Assimp, Glfw, and Bullet3.

I agree with Klugier that it would be great if you could integrate it in OpenGL control. In addition I would ask you to separate (if it is not already done), if possible, the physics from the visualization, as some applications would not require to add Bullet3. This would be great as I think a thin scene graph manager for U++ would be necessary.


I did some test today with GLCtrl and it Worked !

Let me show you how I did it :
#include <CtrlLib/CtrlLib.h>
#include <GLCtrl/GLCtrl.h>
#include <UltimateOpenGL_V2/UltimateOpenGL.h>
using namespace Upp;

struct OpenGLExample : GLCtrl {
	Vector<float> CubeVertices{
		//Here is a vertice of cube
	};
	
	UltimateOpenGL_Context context;
	bool isLoaded = false;

	virtual void GLPaint() {
		if(!isLoaded){
			
			glEnable(GL_DEPTH_TEST);
   		    glEnable(GL_MULTISAMPLE);   // Anti alliasing 
    
			Scene& presentation = context.AddScene("presentation"); //Create Scene 
		    unsigned int camera = presentation.AddCamera(); //Adding camera to the scene
		    Object3D& cube = presentation.CreateGameObject<Object3D>("cube",CubeVertices); //Adding the cube
		    cube.AddTextures("upp","/texture/upp.png",SAMPLE_RGB);
		    cube.BindTexture("upp",0.64f);
		    
		    cube.GetTransform().SetNewPosition(glm::vec3(0.0f,0.0f,-2.0f)); // move the cube forward the camera
		    presentation.Load(); //Loading the scene
		    
		    cube.SetOnDrawFunction([](GameObject& myGameObject){
	    		myGameObject.GetTransform().RotateFromEulerAngles(0.008f,glm::vec3(1.0f,1.0f,1.0f)); // rotating of 0.001 degree every frame
	    	});	
	    	
	    	GameObject& sun =  presentation.CreateGameObject<GameObject>("sun");
	
			sun.AddDirLight("lightSun",DirLight(glm::vec3(0.0f,-1.0f,0.0f),glm::vec3( 0.5f, 0.5f, 0.5f),glm::vec3(0.9f, 0.9f, 0.9f) ,glm::vec3(0.5f, 0.5f, 0.5f)));
			sun.GetTransform().SetNewPosition(glm::vec3(0.0f,3.0f,0.0f));
	    	
	    	isLoaded=true;
		}
        glClearColor(0.4f,0.5f,0.8f, 1.0f); //définie la couleur de fond dans la fenetre graphique 
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //nétoie la fenetre graphique et la regénère
		context.Draw(); //Drawing the context (active scene)
		Refresh();
	
	}
};

GUI_APP_MAIN
{
	Ctrl::GlobalBackPaint();
	TopWindow win;
	OpenGLExample gl;
	gl.SetFrame(InsetFrame());
	win.Add(gl.HSizePos(10, 10).VSizePos(10, 10));
	win.Sizeable().Zoomable();
	win.Open();
	win.Run();
}


To use glew instead of glad.h I did this in UltimateOpenGL:
#ifndef flagUPPGL
	#include <glad/glad.h> //Glad is used to init OpenGL
#else
	#include <GLCtrl/GLCtrl.h>
#endif


If you are wondering why I did an initialisation in the drawing loop and not in window constructor, it's because at window constructor the GL context is not started yet so I can't load and compile thing as shader. Is it a probleme ? I dont know ?

Here is the result : https://imgur.com/1Yf3Rr5

The gif is really slow compared to the reality

however the scene is ugly compared to test on GLFW.
it seems like AntiAliasing is inexistant and texture seems really blurring at some time.
I dont see from what it could come.

[Updated on: Thu, 05 December 2019 13:05]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Bot library for discord, bombs example adapted.
Next Topic: BEMRosetta
Goto Forum:
  


Current Time: Mon Sep 01 01:29:05 CEST 2025

Total time taken to generate the page: 0.00375 seconds