← Back

ofxSurfingPBR

github.com/moebiussurfing/ofxSurfingPBR · @moebiussurfing
OF 0.12 Releases Graphics Shaders

Simple helper with examples for easily testing the new PBR features from OF 0.12+.

3 0 Last commit 1y ago Created 3y ago

README

WIP



OVERVIEW



openFrameworks addon to easily test, learn, and use the new PBR features from the new OF 0.12+ releases.

(You should use the GitHub master branch!)

All this code is copied from and hardly based on this [OF forum topic](https://forum.openframeworks.cc/t/ofshadow-and-ofshader-issue-on-of-0-12/42600/19 ). Original authors: @NickHardeman and @paolo-scoppola.

VIDEO



https://github.com/moebiussurfing/ofxSurfingPBR/assets/2106149/43ac19b8-da41-4dd5-ad4d-b77f885d3e24

<details> <summary>SCREENSHOTS</summary> <p>

1_Example_Basic



2_Example_Models



3_Example_Lights



4_Example_Materials



5_Example_Shadows

6_Example-3D_Parts



</p> </details>

FEATURES



TODO

<details> <summary>USAGE</summary> <p>

EXAMPLE



main.cpp

``.cpp

include "ofApp.h"

include "ofMain.h"



int main() { ofGLWindowSettings settings; settings.setGLVersion(3, 2);

auto window = ofCreateWindow(settings);

ofRunApp(window, make_shared<ofApp>()); ofRunMainLoop(); }

ofApp.h

.cpp

pragma once

include "ofMain.h"



include "ofxSurfingPBR.h"



class ofApp : public ofBaseApp { public: void setup(); void draw();

ofxSurfingPBR pbr; void renderScene(); };

ofApp.cpp

.cpp void ofApp::setup() { pbr.setup();

// Pass the render scene function callback_t f = std::bind(&ofApp::renderScene, this); pbr.setFunctionRenderScene(f); }

void ofApp::draw() { pbr.draw(); pbr.drawGui(); }

void ofApp::renderScene() { // Plane floor pbr.drawPlane();

// Other objects pbr.beginMaterial(); { / DRAW HERE! / } pbr.endMaterial(); }
`

</p> </details>

DEPENDENCIES



REQUERIMENTS

Data for any or new projects: bin/data.zip Data for 2_Example_Models: bin/data.zip Data for 6_Example_3D_Parts`: bin/data.zip Only shaders: bin/dataShaders.zip Folder with all the files: @ MEGA.
  • Notice that all the examples should work without the data files too.
/bin/ -- /data/ ---- /assets/fonts/ - ttf,otf | for ofxGui customize ---- /cubemaps/ - exr,hdr,jpg | for CubeMaps ---- /models/ - obj,ply,fbx | for 3d objects ---- /images/ - jpg,png | for Bg sphere texture ---- /shadersGL2/ - frag,vert | used when enabled ---- /shadersGL3/ - frag,vert | used when enabled

TESTED SYSTEMS

Windows 11 / VS 2022 / OF 0.12+ @ GitHub master branch

LICENSE

MIT License

Get this addon

HTTPS
SSH

Latest release

v0.13 published 2y ago
  • Added custom shaders example: 9_Example_ShaderCustom