Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 27 20:08
    mosra commented #575
  • Jun 27 20:07
    mosra commented #575
  • Jun 27 20:01
    mosra milestoned #575
  • Jun 27 18:26
    hgkjshegfskef starred mosra/magnum
  • Jun 27 15:58

    mosra on master

    Test: use a struct for TestSuit… WebPImporter: whoops, forgot to… MiniExrImageConverter: move dat… and 19 more (compare)

  • Jun 27 15:40

    mosra on next

    KtxImageConverter: recognize Im… KtxImporter: doc++ AstcImporter: mark 3D images wi… and 12 more (compare)

  • Jun 27 15:25

    mosra on next

    KtxImageConverter: recognize Im… KtxImporter: doc++ AstcImporter: mark 3D images wi… and 11 more (compare)

  • Jun 27 14:59
    Squareys opened #575
  • Jun 27 14:28

    mosra on next

    AstcImporter: not sure what was… Test: use a struct for TestSuit… WebPImporter: whoops, forgot to… and 20 more (compare)

  • Jun 27 14:27

    mosra on master

    package/ci: further cap CircleC… Test: consistently use a struct… Return a const& from Compressed… and 19 more (compare)

  • Jun 27 14:06
    duruomeng starred mosra/toolchains
  • Jun 27 09:25

    mosra on next

    package/ci: add explicit resour… package/ci: temporarily disable… package/msys: fix wrong .gitatt… and 24 more (compare)

  • Jun 26 15:25
    YBeyond starred mosra/magnum
  • Jun 25 20:09
    SFilinsky starred mosra/magnum
  • Jun 24 17:02
    mosra commented #96
  • Jun 24 16:54
    mosra commented #96
  • Jun 24 16:42
    hugoam synchronize #96
Azvf
@Azvf
I tried the mothod of disabling the depth test a few days ago but the result is not good looking so I still attempted to render them as normal object using depth test. It's my first time doing this so I wonder if there's a common practice that can render the scene properly when many layers are in the same position.
Vladimír Vondruš
@mosra
what is not good looking about them? the common practice is the painter algorithm i outlined above, rendering the layers back-to-front (submitting the draws in order that draws them back to front, with depth writes disabled)
Azvf
@Azvf
Got it. Thank you for your help, I'll implement that way.🤝
Fo Nz
@FoNz99089892_twitter
Hi at all. I think there is something strange on iOS. Every time you call the mapForDraw method, that framebuffer become useless. It just renders a black screen on it. I'm currently using the 2020.06 version of Magnum. This happens even on the simple triangle example! Infact, the object picking example does render a black screen on iOS.
@mosra Am I missing something? Thanks in advance!
Vladimír Vondruš
@mosra
:eyes:
the vanilla unchanged object picking example renders a black screen?
one has to call mapForDraw() and direct the draw back to the (front? back?) default framebuffer again in order to have something appearing on the screen, but that should be done there
It works on Android and Windows, but not on iOS (both Simulator and real device iOS 15)
Both maxDrawBuffers and maxColorAttachments return 8. I can't understand why.
Vladimír Vondruš
@mosra

does anything improve if you call

    GL::defaultFramebuffer.mapForDraw({Shaders::Phong::ColorOutput, GL::DefaultFramebuffer::ColorAttachment::Back});

(or a variant of it that actually compiles) right before the blit call?

Fo Nz
@FoNz99089892_twitter
But the strange thing is... take a look at this:
http://vec3f.github.io/2014/09/15/deferred-shading-part-1/
He is NOT using layout qualifier, but he use out vec4 fragColor[3];, where 3 is the amount of render targets...

does anything improve if you call

Now I try this in a moment... I have to switch to macOS.

Even though I use the GL::Framebuffer::ColorAttachment{my_index_here} in my own code...
Vladimír Vondruš
@mosra

out vec4 fragColor[3];

huh, never have seen that

but i'd suppose it's equivalent and the location is implicit (0, 1, 2) that way? would need to check the GLSL spec
Fo Nz
@FoNz99089892_twitter

does anything improve if you call

    GL::defaultFramebuffer.mapForDraw({Shaders::Phong::ColorOutput, GL::DefaultFramebuffer::ColorAttachment::Back});

(or a variant of it that actually compiles) right before the blit call?

I think you wanted this, right?

GL::defaultFramebuffer.mapForDraw({{MyShader::ColorOutput, GL::DefaultFramebuffer::DrawAttachment::Back}});

Because I cannot find GL::DefaultFramebuffer::ColorAttachment::Back nor in the docs (last version), nor in 2020.06.

Anyway, always black output in that framebuffer.
Vladimír Vondruš
@mosra
yeah, DrawAttachment, sorry (writing this off the top of my head)
sigh
Fo Nz
@FoNz99089892_twitter
Can you replicate this issue by yourself? Do you have macOS with Xcode and all the stuff along?
Vladimír Vondruš
@mosra
do you get any GL error through Xcode, maybe?
Fo Nz
@FoNz99089892_twitter
Ah no, I don't get any GL error.
Vladimír Vondruš
@mosra
i have a macOS Mini, but no iDevice, and the Mini wasn't powered on for quite a while
Fo Nz
@FoNz99089892_twitter
I have the debug enabled. I can see (quite a lot) lines being logged in Android and Windows, but nothing on iOS.
Vladimír Vondruš
@mosra
iOS doesn't have the GL driver debug output, the only way is through the Xcode OpenGL profiler / tracker, if it still exists there
you'd only see that in Xcode itself
or by checking for GL errors manually
Fo Nz
@FoNz99089892_twitter
Yeah. I'll check manual GL errors tomorrow. I'll let you know. I hope it's not a problem like "layout qualifiers must match indexes in color attachments" or stuff like that...
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