Skip to content

OpenGLES 3 / OpenGLES 3.1#8512

Open
danoli3 wants to merge 39 commits intoopenframeworks:masterfrom
danoli3:OpenGLES3
Open

OpenGLES 3 / OpenGLES 3.1#8512
danoli3 wants to merge 39 commits intoopenframeworks:masterfrom
danoli3:OpenGLES3

Conversation

@danoli3
Copy link
Copy Markdown
Member

@danoli3 danoli3 commented Apr 6, 2026

OpenGLES 3

  • Merged in @mruegenberg changes and patched them into the core.
  • Support for openGLES 3.0
  • Support for openGLES 3.1
  • Fixed up Emscripten defines to allow for ES3
  • This feature allows for emulation more easily in Dawn / Emscripten / Metal / Vulkan for Mobile platforms for ES

Copy link
Copy Markdown
Member Author

@danoli3 danoli3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick review looks good need to check if no regression

@ofTheo
Copy link
Copy Markdown
Member

ofTheo commented Apr 7, 2026

Looks like a big change to quite a few files.
Once it's passing the tests, we should test this branch with the examples before merging.

cc @NickHardeman @dimitre @artificiel @2bbb

@danoli3
Copy link
Copy Markdown
Member Author

danoli3 commented Apr 8, 2026

I keep testing the different examples in macOS. All good so far.

I cherry picked ancient code so will paste over latest formatting soon

Some core changes to ofFbo / ofGLProgrammableRender / ofShadow / ofMaterial / ofGLUtils etc

Critical changes to support Emscripten though

@danoli3 danoli3 moved this to In Progress in openFrameworks Development Apr 8, 2026
@danoli3 danoli3 added this to the 0.12.2 milestone Apr 8, 2026
@danoli3
Copy link
Copy Markdown
Member Author

danoli3 commented Apr 8, 2026

ES3 working on iOS via iOSES3ShaderExample
Simulator Screenshot - iPhone 17 Pro - 2026-04-08 at 12 29 10

@danoli3
Copy link
Copy Markdown
Member Author

danoli3 commented Apr 8, 2026

Simulator Screenshot - iPhone 17 Pro - 2026-04-08 at 14 50 01 OpenGL ES2 / OpenGLES 1 shaders working


void bind(const ofFbo & fbo);
#ifndef TARGET_OPENGLES
#if !defined(TARGET_OPENGLES) || defined(GL_ES_VERSION_3_0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question here:
if TARGET_OPENGLES is also set when GL_ES_VERSION_3_0 is true, would this avoid changing lots of if defined in core? or am I missing something?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it pretty much would always be defined then, need to modify this to is defined and defined enabled like TARGET_OPENGLES_3 that can be user controlled

So far it builds though for iOS and runs with ES3 or ES2 or even ES1 based on main.mm / window

OpenGLES 3 target is best though for dawn or ANGLE auto to Metal / Vulkan btw

@danoli3
Copy link
Copy Markdown
Member Author

danoli3 commented Apr 9, 2026

#ifdef TARGET_OPENGLES
	#if !defined(TARGET_OPENGLES_3)
        #if defined(GL_ES_VERSION_3_0) || \
            (defined(TARGET_EMSCRIPTEN) && defined(USE_WEBGL2)) || \
            defined(TARGET_OPENGLES_3_1) || defined(TARGET_OPENGLES_3_2)
            #define TARGET_OPENGLES_3
            #if defined(GL_ES_VERSION_3_1)
            	#define TARGET_OPENGLES_3_1
            #endif
            #if defined(GL_ES_VERSION_3_2)
            	#define TARGET_OPENGLES_3_2
            #endif
        #endif
    #endif
    // User can force-disable GLES3
    #if defined(TARGET_FORCE_GLES_2) || defined(TARGET_FORCE_GLES_1)
        #undef TARGET_OPENGLES_3
        #undef TARGET_OPENGLES_3_1
        #undef TARGET_OPENGLES_3_2
    #endif
#endif

Added an undef if needed. OpenGL ES1 and ES2 should be easily controlled now if required. It was still working with ES1 and ES2 on iOS tests though. More strict control for older projects though

@danoli3
Copy link
Copy Markdown
Member Author

danoli3 commented Apr 9, 2026

image

trying 3d primitive example in OpenGL 3.2 (programmable) getting the same error I was getting on emscripten

is that happening on master @ofTheo

3DPrimitivesExample

#include "ofApp.h"

//--------------------------------------------------------------
int main(){

	//Use ofGLFWWindowSettings for more options like multi-monitor fullscreen
	ofGLWindowSettings settings;
	settings.setSize(1024, 768);
	settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN
	settings.setGLVersion(3, 2);
	auto window = ofCreateWindow(settings);

	ofRunApp(window, std::make_shared<ofApp>());
	ofRunMainLoop();

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants