From d924e96810793059e6373b289c78b03ae4a3ff23 Mon Sep 17 00:00:00 2001 From: moebiusSurfing Date: Tue, 23 Jan 2024 23:03:53 -0300 Subject: [PATCH] updated data.zip link files on readme's. checked all examples --- 1_Example_Basic/README.md | 26 -------------------------- 2_Example_Models/README.md | 22 +--------------------- 3_Example_Lights/README.md | 19 ------------------- 4_Example_Materials/README.md | 10 ---------- 5_Example_Shadows/README.md | 15 --------------- 6_Example_3D_Parts/README.md | 28 +--------------------------- README.md | 10 +++++----- src/SurfingSceneManager.cpp | 15 +++++++++++++-- src/ofxSurfingPBR.h | 14 ++++++++------ 9 files changed, 28 insertions(+), 131 deletions(-) diff --git a/1_Example_Basic/README.md b/1_Example_Basic/README.md index c6859ec..a07bba2 100644 --- a/1_Example_Basic/README.md +++ b/1_Example_Basic/README.md @@ -1,27 +1 @@ - -This example includes the main and bigger class from the addon: -`ofxSurfingPBR.h`. - -This class has multiple modules -or commonly used features included by default: - -- Floor plane with a simple material - and customizable size and transforms. -- One full PBR material ready to be used. -- CubeMap for the PBR material and drawing as background. -- Background object with sphere or box with material. -- Test Scene draw with three prims. -- Lights bundle with 4 predefined lights: - `Point`, `Direct`, `Spot` and `Area`. -- An internal and public exposed camera. -- Shader module to help integration/dev. - (currently commented / disabled by default) - -All the modules has his own settings and a gui (ofGui) -to tweak all the internal parameters. -All of them with all the settings persistent, -gui exposed and ready to use on any project. - -
- ![](Capture.PNG) \ No newline at end of file diff --git a/2_Example_Models/README.md b/2_Example_Models/README.md index e9d8a1d..0a56ab4 100644 --- a/2_Example_Models/README.md +++ b/2_Example_Models/README.md @@ -1,23 +1,3 @@ - -[bin/data.zip](https://mega.nz/file/saMXjATJ#hCcfG5KWJrRnwX85Wy0MmH0JMViaToS1MyOejCIxSZY) - -
- -This example uses the main class from the `ofxSurfingPBR.h` addon. -The above class bundles almost all the modules/features from the addon. -Many modules can be used as standalone, in a simpler and custom OF scene. - -Also we are using the `SurfingSceneManager.h` class -how uses also `SurfingModelsFilesBrowser.h`. -These classes are `3d models` helpers paired with the addon. -With these classes we can easily browse the `3d models` files -directly from our app `bin/data/` path. - -As we are using the full addon modules from `ofxSurfingPBR.h`, -we can render the objects using the bundled materials, -the plain floor, and all the `4 lights kit`, -the background generators and the cubeMap. - -
+[bin/data.zip](https://mega.nz/file/lOMzkJIC#tLaM9MTKA6J83nf0DoxKtoET3uevG-Y6z4_eLfIiIPQ) ![](Capture.PNG) \ No newline at end of file diff --git a/3_Example_Lights/README.md b/3_Example_Lights/README.md index cd5d765..a07bba2 100644 --- a/3_Example_Lights/README.md +++ b/3_Example_Lights/README.md @@ -1,20 +1 @@ -This example do not includes the main bigger classes from the addon: -`ofxSurfingPBR.h` neither the `SurfingSceneManager.h`. -These both classes have multiple modules or features included by default, -(as it could be the CubeMap, the background object, the floor plane...etc). - -Here we want to learn and create a standalone material -and a standalone kit of lights. -The material is applied to the floor plane -and to the testing three prims scene that we will draw. - -The lights bundled are 4 in total. One of each of the available types -into OF core: -`Point`, `Direct`, `Spot` and `Area`. -All with his settings on a gui to tweak all the internals. -All of them with all the settings persistent, gui exposed and ready -to use on any project. - -
- ![](Capture.PNG) \ No newline at end of file diff --git a/4_Example_Materials/README.md b/4_Example_Materials/README.md index 9067b05..a07bba2 100644 --- a/4_Example_Materials/README.md +++ b/4_Example_Materials/README.md @@ -1,11 +1 @@ - -This example uses the internal class `SurfingMaterial.h`. -We will create a vector of materials to be applied to many objects. -To draw the object we will use the `SurfingMeshSphereDisplaced.h` class. -We will have an animated mesh to test the PBR settings on there. -We will create also some `ofLight`'s from the `OF core` -to see how the addon can easily mix-up with the core/"vanilla" classes. - -
- ![](Capture.PNG) \ No newline at end of file diff --git a/5_Example_Shadows/README.md b/5_Example_Shadows/README.md index 8f82d6d..a07bba2 100644 --- a/5_Example_Shadows/README.md +++ b/5_Example_Shadows/README.md @@ -1,16 +1 @@ -This example is hardly based on the example -`openFrameworks\examples\gl\shadowsExample` -from the `OF Core` made by `@NickHardeman`. -We will learn how to replace easily their `OF materials` -with standalone materials that the addon includes, -in this case will be standalone: -all the rest of the environment will remain un-touched -from the example, this means that we will not use -the lights modules from the addon bigger classes like -`ofxSurfingPBR.h` or `SurfingSceneManager.h` neither: -only the "vanilla" classes that bundles the `OF Core` will be used -besides of the material class instances for ach scene element. - -
- ![](Capture.PNG) \ No newline at end of file diff --git a/6_Example_3D_Parts/README.md b/6_Example_3D_Parts/README.md index ea8f5bf..0a78e0f 100644 --- a/6_Example_3D_Parts/README.md +++ b/6_Example_3D_Parts/README.md @@ -1,30 +1,4 @@ - -[bin/data.zip](https://mega.nz/file/5Klk0ZZA#nDyOPUj6tvw-g271pFeunr8EA7dBn5juWXZgrJkkOGk) - -
- -## EXAMPLE DESCRIPTION - -This example shows how to illuminate a loaded `FBX model` -affecting their `PBR texture files`. -Also, we have a data folder with some parts of the model -that we exported separately manually -from Blender, Cinema4D, or any others. -`bin/data/models/nike/parts/*.*` - -We will use the `SurfingSceneManager.h` class to customize the scene. -This class auto-creates a combo of the four default lights, -to perform the light illumination, - -Also allows queuing materials and colors to our scene. -We will create a material for each part, -so we can tweak each PBR material color and the PBR settings -for each part independently. - -We have also a rotating camera with height and longitude settings. -Also, we can apply one single aux material when using the floor and on the OnePiece mode. - -
+[bin/data.zip](https://mega.nz/file/VPMBEBTJ#Cgi-u72GdJOMel7xCli2-SmU7aU0b0TtOijyuXIDKdc) ![](Capture.PNG) diff --git a/README.md b/README.md index 69f605e..8a4078a 100644 --- a/README.md +++ b/README.md @@ -160,9 +160,9 @@ void ofApp::renderScene() ## REQUERIMENTS - Download and copy the content of `data.zip` to the examples or to your projects into `/bin/data`: - * Data for any: [bin/data.zip](https://mega.nz/file/cHkylJZY#sVdQpSF8IkvdmKdpMIbA4767kvBvfGL7R7GnU9g20ow) - * Data for `2_Example_Models`: [bin/data.zip](https://mega.nz/file/saMXjATJ#hCcfG5KWJrRnwX85Wy0MmH0JMViaToS1MyOejCIxSZY) - * Data for `6_Example_3D_Parts`: [bin/data.zip](https://mega.nz/file/5Klk0ZZA#nDyOPUj6tvw-g271pFeunr8EA7dBn5juWXZgrJkkOGk) + * Data for any or new projects: [bin/data.zip](https://mega.nz/file/cHkylJZY#sVdQpSF8IkvdmKdpMIbA4767kvBvfGL7R7GnU9g20ow) + * Data for `2_Example_Models`: [bin/data.zip](https://mega.nz/file/lOMzkJIC#tLaM9MTKA6J83nf0DoxKtoET3uevG-Y6z4_eLfIiIPQ) + * Data for `6_Example_3D_Parts`: [bin/data.zip](https://mega.nz/file/VPMBEBTJ#Cgi-u72GdJOMel7xCli2-SmU7aU0b0TtOijyuXIDKdc) * Only shaders: [bin/dataShaders.zip](https://mega.nz/file/gLMwXY6S#HjIfsu80ZIpPccaFbJKowE3qeoRZeK8jnfSrhUEeGQE) - Notice that all the example should work without the data files too. @@ -176,7 +176,7 @@ $~~~~~~$ ├ shadersGL2 $~~~~~~$ frag, vert $~~~~~~$ used when enabled $~~~~~~$ └ shadersGL3 $~~~~~~$ frag, vert $~~~~~~$ used when enabled ## TESTED SYSTEMS -* **Windows 11** / **VS 2022** / **OF 0.12+** @[GitHub master branch](https://github.com/openframeworks/openFrameworks) +* **Windows 11** / **VS 2022** / **OF 0.12+** @ [GitHub master branch](https://github.com/openframeworks/openFrameworks) ## LICENSE -**MIT License** +**MIT License** \ No newline at end of file diff --git a/src/SurfingSceneManager.cpp b/src/SurfingSceneManager.cpp index 56aa153..7778136 100644 --- a/src/SurfingSceneManager.cpp +++ b/src/SurfingSceneManager.cpp @@ -285,12 +285,23 @@ void SurfingSceneManager::drawGui() { gui.draw(); if (lights.bGui) { - ofxSurfing::setGuiPositionRightTo(lights.gui, gui); + ofxSurfing::setGuiPositionRightTo(lights.gui, gui); //gui is SCENE_MANAGER lights.drawGui(); } if (bGui_Materials) { - ofxSurfing::setGuiPositionRightTo(guiMaterials, lights.bGui ? lights.gui : gui); + //ofxSurfing::setGuiPositionRightTo(guiMaterials, lights.bGui ? lights.gui : gui); + if (!lights.bGui_Shadows) { + if (lights.bGui) + ofxSurfing::setGuiPositionRightTo(guiMaterials, lights.gui); + else + ofxSurfing::setGuiPositionRightTo(guiMaterials, gui); + } else { + if (lights.bGui) + ofxSurfing::setGuiPositionRightTo(guiMaterials, lights.guiShadows); + else + ofxSurfing::setGuiPositionRightTo(guiMaterials, gui); + } guiMaterials.draw(); } diff --git a/src/ofxSurfingPBR.h b/src/ofxSurfingPBR.h index 84a37c9..81fdd74 100644 --- a/src/ofxSurfingPBR.h +++ b/src/ofxSurfingPBR.h @@ -10,14 +10,14 @@ from the new 0.12+ releases. You should use the GitHub master branch: - https://github.com/openframeworks/openFrameworks + https://github.com/openframeworks/openFrameworks All this code is copied from or/and hardly based on this OF forum topic: - https://forum.openframeworks.cc/t/ofshadow-and-ofshader-issue-on-of-0-12/42600/19 + https://forum.openframeworks.cc/t/ofshadow-and-ofshader-issue-on-of-0-12/42600/19 Original inspiration code authors: - @NickHardeman https://github.com/NickHardeman - and @paolo-scoppola https://github.com/paolo-scoppola. + @NickHardeman https://github.com/NickHardeman + and @paolo-scoppola https://github.com/paolo-scoppola. */ //-- @@ -25,12 +25,13 @@ /* TODO - - fix lights settings + - fix startup/exit loading all settings + - fix lights settings not recalled well at startup - add simple scenes presets manager - expose easy paramsPresets: colors, lights power, + to be used on a simple/user UI. - add save/load all. - - fix startup/exit loading all settings - make some linking colors to fast set bg, floor, @@ -41,6 +42,7 @@ - add custom global path to /data/ofxSurfingPBR/MAT_NAME/ - SHADERS AND DISPLACE + - get @paolo-scoppola ideas and suggestions. - fix plane light not working when shaders enabled.. - check pipeline / enable ArbTex from the example! - customize share plane divisions and img size/clamp.