FragM 2.5.0 update

  • 74 Replies
  • 2656 Views

0 Members and 1 Guest are viewing this topic.

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1484
    • Digilantism
« Reply #60 on: December 16, 2019, 09:25:00 PM »
Yeah thats a Mac thing alright. If it compiles on the TravisCi machine Im happy but I dont really want to maintain 3 different package versions.

Considering a source only package  :P
Fragmentarium is not a toy, it is a very versatile tool that can be used to make toys ;)

https://en.wikibooks.org/wiki/Fractals/fragmentarium

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1484
    • Digilantism
« Reply #61 on: December 17, 2019, 01:41:41 AM »
One reason Mac might fail is crippled OpenGL support. They want you to use proprietary Metal. Also notarization requirements in latest version are hostile.

yup, none of the GL_DEBUG stuff works on Mac and upgrading the OS on my MacBook is impossible, they want $99.00 for an upgrade that still won't work with FragM's requirements, can't even install HomeBrew package manager or Xcode at the required version level to handle compiling FragM so I don't see FragM for Mac any other way than compile your own from source. (cuz I'm not going to buy a new one)

 so the MacBook is going in the bin. >:D

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1484
    • Digilantism
« Reply #62 on: January 22, 2020, 04:15:25 AM »
Latest push to sources on github gl4dev branch

* using shaders to render the camera/target paths
* compiles and runs on
    Vendor: NVIDIA Corporation
    Renderer: GeForce GTX 760/PCIe/SSE2
    GL Driver: 4.5.0 NVIDIA 418.87.00
    Using GL 4.5 Core profile

* renders all frags properly

gl4 core mods done:

* set up matrices for tiled render, works!

all that is required to use the current shader base files is...
in BufferShader frags and 3D frags add these 2 lines to the beginning of the vertex section
Code: [Select]
layout(location = 0) in vec4 vertex_position;
uniform mat4 projectionMatrix;

...and in the rest of the vertex code change gl_Vertex to vertex_position and gl_ProjectionMatrix to projectionMatrix

edit: also need to rework all varying to in/out

...then add this line to the beginning of the user shader...
Code: [Select]
#version 450 core
this seems to run as expected when using gl 4.5 core profile but needs testing to verify all features and modes work properly, the above mentioned changes to fragment files is only for tiled rendering, without those changes all frags still render but mosaic for tile mode.

( it was easier than I thought :) reminder that this "patch" is bruteforce and the code needs cleaning  )
« Last Edit: January 25, 2020, 05:47:32 AM by 3DickUlus, Reason: info »

Offline claude

  • *
  • 3f
  • ******
  • Posts: 1344
    • mathr.co.uk
« Reply #63 on: January 23, 2020, 10:08:29 PM »
Trying it now.  Start of log says it is enabled:
Code: [Select]
Vendor: X.Org
Renderer: Radeon RX 580 Series (POLARIS10, DRM 3.35.0, 5.4.3, LLVM 7.0.1)
GL Driver: 4.5 (Core Profile) Mesa 18.3.6
Using GL 4.5 Core profile

User frag with #version 400 compatiibility or #version 330 compatibility fails to compile script with
Code: [Select]
/home/claude/M.frag :1(10): error: the compatibility profile is not supportedwhich I suppose is to be expected.

User frag with #version 330 core or #version 400 core reports
Code: [Select]
/home/claude/M.frag :38(24): error: `gl_ProjectionMatrix' undeclared
/home/claude/M.frag :38(46): error: `gl_Vertex' undeclared

I added this to the start of my #vertex sections (2D camera and buffer shader, in my Trudy stuff; as well as 3D camera and buffer shader, in my Raymond stuff)
Code: [Select]
#ifndef GL_compatibility_profile
layout(location = 0) in vec4 vertex_position;
uniform mat4 projectionMatrix;
#define gl_Vertex vertex_position
#define gl_ProjectionMatrix projectionMatrix
#endif

Then set #version 330 core or #version 400 core at the start of the user frag, and it all works fine, tiled rendering too!  Good job!

Though, I think the best thing for FragM do is try to create a compatibility profile first, and if that fails (or gives a low version like OpenGL 2) then retry with a high-version core profile.  Or maybe make core-vs-compatibility a preferences option.  AFAIK everything core also works in compatibility (including core shaders), but not the other way around, the only thing is some drivers only support new GL in core profile (no compatibility profile for GL 4 on OS X or some such, also old Mesa, but recent Mesa is fine).
« Last Edit: January 23, 2020, 10:30:11 PM by claude, Reason: it works! »

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1484
    • Digilantism
« Reply #64 on: January 24, 2020, 05:51:53 PM »
The code is only checking profile type not version. Good news that its working on Radeon.
Yes, compat first and core if no compat is the plan but making it a user option will require some head scratching and definately a restart.

Because the changes are really simple it might be an idea to automajically do the conversion so when frags are saved they will not need further editing.

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1484
    • Digilantism
« Reply #65 on: January 25, 2020, 01:31:39 AM »
just to re-iterate  :))

all that is required to use the current shader base files is...
in BufferShader frags and 3D frags add these 2 lines to the beginning of the vertex section
Code: [Select]
layout(location = 0) in vec4 vertex_position;
uniform mat4 projectionMatrix;

...and in the rest of the vertex code change gl_Vertex to vertex_position and gl_ProjectionMatrix to projectionMatrix

...then add this line to the beginning of the user shader...
Code: [Select]
#version 450 core

@claude is the definition of GL_compatibility_profile something the user has to manage?  would be nice if it could test for a built-in var that reflects profile status.

The goal is to move away from legacy code entirely and hopefully take advantage of some modern features.

edit:
according to kronos...
 
Quote from: https://www.khronos.org/registry/OpenGL-Refpages/
Current API Versions

    OpenGL ES 3.2 and OpenGL ES Shading Language 3.20

    OpenGL 4.5 and OpenGL Shading Language 4.50

...so this is my target. edit2: OpenGL 3.3 <-> 4.5
« Last Edit: January 25, 2020, 05:50:40 AM by 3DickUlus »

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1484
    • Digilantism
« Reply #66 on: January 25, 2020, 03:10:46 AM »
 :fp: just found it
Quote
The macro GL_core_profile is always defined to be "1". The macro GL_compatibility_profile is only defined to be "1" if the version for this shader was set to be compatibility.
  :thumbs: @claude  :yes:

still needs a lot of testing and tweaking yet...
« Last Edit: January 25, 2020, 05:23:27 AM by 3DickUlus »

Offline Recursed

  • *
  • Fractal Freshman
  • *
  • Posts: 4
« Reply #67 on: February 16, 2020, 10:58:09 PM »
Hi, I've just downloaded FragM (actually updated to MacOS 10.14 specifically to run this). Unfortunately:
- The OpenGL-shader source throws errors about the "#version"-thing, which was solvable but not always.
- It also throws a "ERROR: 4:20: 'varying' : syntax error : syntax error" for each example, which I'm not able to get rid of. Any ideas how to solve this?

Thanks in advance for your help, I'm really looking forward to using this. I played around a bit with a very old version, which unfortunately broke after the update, so no more fractaling for me right now.  :(

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1484
    • Digilantism
« Reply #68 on: February 17, 2020, 12:20:31 AM »
The latest  FragM is capable of running under GL4.5 core profile,
do you compile from source or use the OSX app from github?

"varying" may have to be changed to "in/out" types
« Last Edit: February 17, 2020, 12:38:09 AM by 3DickUlus »

Offline Recursed

  • *
  • Fractal Freshman
  • *
  • Posts: 4
« Reply #69 on: February 17, 2020, 10:47:21 AM »
Thanks for your quick reply, I use the prepackaged release on Github. It seems as if I need to add "#version 410" on the first line of every example.

The "varying" problem seems to stem from 3D.frag, what should I change them to? I've tried a couple things, but changing it to "inout" results in the compiler complaining that this is not allowed in the global scope. If I change them to to either "in" or "out", I get errors about "Use of undeclared identifier 'gl_Vertex'" and a couple of other variables which seem to be built-in. This post seems to describe a similar problem: https://forum.openframeworks.cc/t/fragment-shaders-errors-said-undeclared-but-i-did/26925/8
« Last Edit: February 17, 2020, 11:06:06 AM by Recursed »

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1484
    • Digilantism
« Reply #70 on: February 17, 2020, 11:22:43 AM »
in 3D.frag #vertex section you need outs...
Code: [Select]
out vec2 viewCoord;
out vec2 coord;
out vec2 PixelScale;
out vec2 viewCoord2;
out vec3 from;
out vec3 dir;
out vec3 Dir;
out vec3 UpOrtho;
out vec3 Right;

...then after #endvertex ( in fragment code ) you need the ins...
Code: [Select]
// Camera position and target.
in vec2 viewCoord;
in vec2 coord;
in vec2 PixelScale;
in vec2 viewCoord2;
in vec3 from;
in vec3 dir;
in vec3 Dir;
in vec3 UpOrtho;
in vec3 Right;
...and one out...
Code: [Select]
out vec4 FragColor;...then at the very end of the 3D.frag file change gl_FragColor to FragColor

you will also need, as the first line after #vertex...
Code: [Select]
layout(location = 0) in vec4 vertex_position;...and change gl_vertex to vertex_position

these files also use uniform mat4 projectionMatrix; and I don't think any of the released binaries know about that so you will need to build from source in gl4dev branch. You will have to set the GL version from 4.5 to 4.1 to compile on your mac... should probably make that a compile time test so you don't have to adjust it manually... is GL 4.1 the highest version new macs support???

attached are the test files I use with GL 4.5 core, you can find the source at github gl4dev branch

1. put them in Examples/Include/ folder
2. run FragM and load Examples/Historical 3D Fractals/Mandelbulb.frag
2a you may have to add #version 450
3. change #include "DE-Raytracer.frag" to #include "DE-Raytracer-gl4.frag"
4. click the Build button

Offline Recursed

  • *
  • Fractal Freshman
  • *
  • Posts: 4
« Reply #71 on: February 17, 2020, 01:15:48 PM »
Yes OpenGL 4.1 is the latest on MacOS atm (and probably forever), their GPU-game is really lacking. They want you to use their shiny Metal-stuff instead of the standards.

Regarding your gl4-versions. I needed to replace the texture2D()-calls with texture(), seeing that the former is deprecated. They now seem to compile, although I get a black screen. Probably due to the ProjectionMatrix? So I'll have a look at the compiling (ugh).

Any idea why the older version (Fragmentarium 0.9.12) could use the shaders? Is that purely due to the profile set?

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1484
    • Digilantism
« Reply #72 on: February 17, 2020, 09:28:31 PM »
hm.. not sure about the logic behind the internals of Mac OSX  :-\

Linux nVidia driver defaults to #version 110 when there is no #version statement in the GLSL fragment code, and regardless of the OS GL profile you should be able to use all versions of GLSL that the driver supports. With Apple pushing their own Metal glsl derivative language there may even be problems at the driver kernel level that I can't overcome.

If you are not a coder or haven't/can't (simply don't want to) set up a dev environment on your Mac I will run it through Travis-CI with a few version adjustments, 4.1 instead of 4.5 etc but I can't test it in Mac form, only on linux here. This will be from the gl4dev branch and because Mac only supports GL4.1Core you will not have any GL debug features found in 4.5.

here is a link to a thread on mac issues that was, for the most part, resolved to the point where the source compiles and the executable runs on mac Crashes at startup on mac os mojave
this is using master or Development branches, the gl4dev branch represents progress since then toward getting the internals of FragM modernized.

re: 0.9.12 ... things have changed a lot since then ... 09 Sep 2012 ... I can't even compile that source code any more due to linux/Qt development progress.

Offline Recursed

  • *
  • Fractal Freshman
  • *
  • Posts: 4
« Reply #73 on: February 18, 2020, 01:00:22 PM »
Sorry, I must've been a bit unclear in my last post. OpenGL 4.1 should work fine on MacOS, with some exceptions, but those probably don't apply to Fragmentarium. However, Apple wants you to use their proprietary Metal stuff and has deprecated OpenGL, so expect no further updates on it.

The old version, which I got from Syntopia's site and runs/outputs several of the shaders, does run on my current setup. What confuses me is that that version does accept shaders which have "varying" or lack the "#version XXX". The new version does throw errors on that, any idea why that could be?

If you'd be willing to push it through Travis, I would be very, very grateful. I also think that the current version would be broken for all Mac users, unless anyone has another experience??

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1484
    • Digilantism
« Reply #74 on: Yesterday at 04:43:23 PM »
Older versions did not attempt to set version or profile. As a result the vertex and fragment parts would not get the same version. Now FragM ensures that vertex and fragment parts have the same version.

Another issue was the way Qt presented GL. It gave you the version and profile that it figured would be best. Which meant not always what you would expect.

If mac is deprecating GL in favor of their proprietary stuff then I probably wont be trying to keep up with that  :-\ ...


xx
Jwildfire 4.10 Big update.

Started by Caleidoscope on Downloads

0 Replies
231 Views
Last post May 14, 2019, 01:44:16 PM
by Caleidoscope
xx
win10 update Tdr issue

Started by mclarekin on Fractal Programs Discussion, Help, & Support

0 Replies
75 Views
Last post July 30, 2019, 01:48:27 AM
by mclarekin
xx
And yet another great update in JWildfire 5.00 introducing weighting-fields

Started by Caleidoscope on Downloads

0 Replies
273 Views
Last post June 28, 2019, 02:22:57 PM
by Caleidoscope
xx
FragM 2.5.0

Started by 3DickUlus on Fragmentarium

51 Replies
1637 Views
Last post April 21, 2019, 12:37:28 PM
by 3DickUlus
clip
More lights for FragM

Started by 3DickUlus on Code Snippets (fragments)

10 Replies
175 Views
Last post July 12, 2019, 05:31:31 AM
by 3DickUlus