Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:21

    mosra on master

    Utility: optimize populating la… (compare)

  • 15:00
    ajunlonglive starred mosra/magnum
  • 14:43
    xiaosz starred mosra/magnum
  • 12:56

    mosra on next

    Containers: fix a Doxygen warni… Utility: optimize populating la… (compare)

  • 12:56

    mosra on master

    package/ci: drop Gitter webhook… Containers: doc++ Containers: doc++ and 5 more (compare)

  • 12:34

    mosra on next

    Utility: GCC 4.8 you're a very … (compare)

  • 12:26

    mosra on next

    package/ci: drop Gitter webhook… Containers: doc++ Containers: doc++ and 3 more (compare)

  • Jan 24 20:28

    mosra on next

    Shaders: rename MeshVisualizer … Shaders: add missing MeshVisual… Shaders: add a multidraw MeshVi… (compare)

  • Jan 24 19:01

    mosra on next

    Shaders: add MeshVisualizer TBN… Shaders: minor, but confusing. … Shaders: reduce redundant expre… and 2 more (compare)

  • Jan 24 17:40

    mosra on next

    Shaders: add MeshVisualizer TBN… Shaders: minor, but confusing. … Shaders: reduce redundant expre… and 2 more (compare)

  • Jan 24 17:21

    mosra on next

    Shaders: add MeshVisualizer TBN… Shaders: minor, but confusing. … Shaders: reduce redundant expre… and 2 more (compare)

  • Jan 24 16:27
  • Jan 24 15:18
    codecov[bot] commented #547
  • Jan 24 14:25
    jnewman314 starred mosra/magnum
  • Jan 24 12:43

    mosra on master

    Shaders: drop a bunch of redund… Shaders: clean up GL version re… Shaders: minor test cleanup. and 6 more (compare)

  • Jan 24 12:19
    codecov[bot] commented #547
  • Jan 24 12:19
    pezcode synchronize #547
  • Jan 23 21:56
    jvannugteren commented #94
  • Jan 23 21:15

    mosra on next

    Shaders: drop a bunch of redund… Shaders: clean up GL version re… Shaders: minor test cleanup. and 6 more (compare)

Fo Nz
@FoNz99089892_twitter
Thanks anyway!
ytain
@ytain:matrix.org
[m]
the OpenGL profiler tool from xcode tools are still there, you just have to look in the additional downloads webpage
Mathew
@lectroMathew
Currently AspectRatioPolicy in SceneGraph::Camera is hardcoded with default ::NotPreserved value, is this by design? Would be nice to get it as parameter or maybe configurable global default
Mathew
@lectroMathew
Also, I think that usage of SceneGraph::Camera::_rawProjectionMatrix declared here is redunant? Since this is the only usage of it as rhs, it can be replaced with original SceneGraph::Camera::_projectionMatrix, making SceneGraph::Camera::fixAspectRatio modify the value directly. Correct me if I'm wrong
Vladimír Vondruš
@mosra

Would be nice to get it as parameter

you mean setAspectRatioPolicy(AspectRatioPolicy)? :) if you want to have a global configurable default, easiest is to create your own subclass (you wouldn't believe how painful mutable globals sometimes are, which is why i tend to avoid them)

the _rawProjectionMatrix is there because if you call the setAspectRatioPolicy() or setViewport(), it "bakes" _projectionMatrix from the raw one and the aspect ratio correction, and on a subsequent call it would have no way to know what the original ("raw") projection was to correct it again
Fo Nz
@FoNz99089892_twitter

or by checking for GL errors manually

glGetError returns no error. Also, framebuffer appears to be complete and its assertions are valid.

Vladimír Vondruš
@mosra

ah well, i don't know ... so it's any call to mapForDraw() that breaks it and if it's not there it works?

even the implicit .mapForDraw({{Shaders::Phong::ColorOutput, GL::Framebuffer::ColorAttachment{0}}); with no other attachment breaks it?

FoNz
@FoNz80555345_twitter

ah well, i don't know ... so it's any call to mapForDraw() that breaks it and if it's not there it works?

even the implicit .mapForDraw({{Shaders::Phong::ColorOutput, GL::Framebuffer::ColorAttachment{0}}); with no other attachment breaks it?

Yes. I'm experimenting a bit, and yes. Even with only Color output in both Framebuffer and Phong shader output all black!

From the Object picking example, when I do _color.setStorage(GL::RenderbufferFormat::RGBA8, GL::defaultFramebuffer.viewport().size()); then all rendering becomes black. Even if I delete all the mapForDraw, blit and other framebuffer setup code. I keep only the GL::defaultFramebuffer, untouched, as it comes from the main.
Vladimír Vondruš
@mosra
huh, that's really strange
Vladimír Vondruš
@mosra
ohhh i know! sorry, didn't realize this platform has no default framebuffer
i'm on a call right now, will post a more detailed reply 30mins - 1hr later :)
Vladimír Vondruš
@mosra
so, the issue is (if i remember correctly) that iOS doesn't have a default framebuffer, i.e. a framebuffer with ID == 0
and because magnum uses state tracking, for basic workflow it never even attempts to bind a framebuffer with ID 0, as the state tracker assumes it's bound by default (which it is, in cases of platforms where a default framebuffer is a thing)
thus basic examples all work, but everything breaks once you attempt to create a custom Framebuffer and attach something to it -- then it binds it, and when going back to GL::defaultFramebuffer, it binds framebuffer with ID 0 instead of the actual custom framebuffer object iOS uses by default
the fix here should be querying the ID of the iOS default implicit framebuffer as the first thing, wrapping it into magnum's Framebuffer object and then using that instead of GL::defaultFramebuffer
Vladimír Vondruš
@mosra
i have a feeling that we discussed it here with somebody some months ago once already, if i find it then i could give you a ready-made code for this
it seems that it's a bit more complicated, in fact
Vladimír Vondruš
@mosra
GLint iosDefaultFramebufferId; // do this as the first thing ever
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &iosDefaultFramebufferId);

GL::Framebuffer iosDefaultFramebuffer = GL::Framebuffer::wrap(iosDefaultFramebufferId, GL::defaultFramebuffer.viewport());
could get you the iOS default framebuffer (which you then use in place of GL::defaultFramebuffer everywhere), but then (according to the messages from back then) you also need to query the original renderbuffer and then rebind it right before a buffer swap:
GLint iosDefaultRenderbufferId; // also as the first thing ever
glGetIntegerv(GL_RENDERBUFFER_BINDING, &iosDefaultRenderbufferId);

// right before a buffer swap
glBindRenderbuffer(GL_RENDERBUFFER, iosDefaultRenderbuffer);
// so the state tracker doesn't think some other renderbuffer is still bound
GL::Context::current().resetState(GL::Context::State::Framebuffer);

swapBuffers();
adding this to my documentation TODOs, don't want to reinvent the same wheel for the third time :)
i hope this helps! :)
FoNz
@FoNz80555345_twitter
Ok thanks a lot! I didn't know a default framebuffer doesn't exist in iOS. I'll try this later. Thanks again.
Vladimír Vondruš
@mosra
i'm not exactly sure if it needed to be the default framebuffer as well, but the renderbuffer definitely
this sequence of magic incantations worked before, and i don't have an iOS device around to test it ... so if just the renderbuffer part works, please let me know :)
FoNz
@FoNz80555345_twitter
Yea, it works! But picking does not work. I scanned the entire renderbuffer, but it's all 0. Maybe is the same problem.
FoNz
@FoNz80555345_twitter
How do I pass SDL_GL_RETAINED_BACKING flag through Magnum's main? Maybe that's the problem...
It should be passed before SDL_CreateWindow
FoNz
@FoNz80555345_twitter
I think I have to override the tryCreate method when I extend the Sdl2Application class...
FoNz
@FoNz80555345_twitter
Mhh no change in behavior... still I got 0 everywhere in the renderbuffer for object picking
FoNz
@FoNz80555345_twitter
Anyway, seeing my game on iOS bring tears to my eyes!
FoNz
@FoNz80555345_twitter
Wait... it works on a real device, but not in Simulator... I have read previously this thing around the internet... anyway it works!!
Vladimír Vondruš
@mosra
yayyyyy
Vladimír Vondruš
@mosra
@FoNz80555345_twitter which of the two snippets were needed, after all? both or just the renderbuffer part?
FoNz
@FoNz80555345_twitter

@FoNz80555345_twitter which of the two snippets were needed, after all? both or just the renderbuffer part?

I replaced the GL::defaultFramebuffer with myOwnDefaultFramebuffer (which I obtained through GL::Framebuffer::wrap function, giving the ID of the framebuffer obtained through glGetIntegerv) everywhere for iOS and Simulator. Also, I needed to also do:

glBindRenderbuffer(GL_RENDERBUFFER, myOwnDefaultRenderbuffer);
GL::Context::current().resetState(GL::Context::State::Framebuffer);

Right after switching to the "default" framebuffer. Without this, it doesn't work, even if I bind the "default" framebuffer.

All of my render targets work with mouse picking!! :)
Vladimír Vondruš
@mosra
so myOwnDefaultFramebuffer has a non-zero ID, right? just double-checking i understand this properly
pezcode
@pezcode
Shot in the dark but maybe someone knows: is there a way to override CMake project languages from the command line?
Vladimír Vondruš
@mosra
you mean the languages in project()?
pezcode
@pezcode
yeah
I found CMAKE_PROJECT_INCLUDE which kinda does what I want but it's hacky and requires 3.15
Lets me just include a file with enable_language(XXX)
Vladimír Vondruš
@mosra
yep, that .. could be doable with a toolchain file, i hope?
or make a wrapper CMakeLists that add_subdirectory()s the otiginal project, and has a project() with languages you want? not sure how that propagates into nested projects tho
which extra languages you need?
pezcode
@pezcode
I need C for try_compile, and I'll let you take a guess which favorite trashcan library of yours is making me do this
hint: it starts with ass :eyes:
Vladimír Vondruš
@mosra
HAH