Where communities thrive


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

    mosra on next

    python: handle Windows path ins… python: adapt to Magnum changes… python: expose new linear RGB(A… (compare)

  • 01:11

    mosra on next

    python: reorder trade.MeshData … (compare)

  • Feb 08 18:25

    mosra on master

    Clarify MAGNUM_BUILD_DEPRECATED… doc: show a gallery of all prim… Math: rename Color[34]::fromSrg… and 6 more (compare)

  • Feb 08 17:48

    mosra on next

    Clarify MAGNUM_BUILD_DEPRECATED… doc: show a gallery of all prim… Math: rename Color[34]::fromSrg… and 5 more (compare)

  • Feb 08 15:36
    Build #2090 passed
  • Feb 08 12:24

    mosra on next

    python: handle Windows path ins… (compare)

  • Feb 08 12:07

    mosra on master

    UfbxImporter: explicitly mentio… UfbxImporter: expose no scene f… external: update ufbx to 0.3.0.… (compare)

  • Feb 08 11:19

    mosra on master

    python: add a dedicated test fo… python: fix to build with pybin… python: expose all index/attrib… and 6 more (compare)

  • Feb 08 09:42
    caniouff starred mosra/magnum
  • Feb 08 00:29

    mosra on next

    python: adapt the MeshData test… (compare)

  • Feb 08 00:22

    mosra on next

    python: adapt the MeshData test… (compare)

  • Feb 08 00:10

    mosra on next

    python: no, using backward slas… python: expose the BUILD_DEPREC… python: adapt the MeshData test… (compare)

  • Feb 07 23:32

    mosra on next

    python: fix to build with pybin… python: expose all index/attrib… python: mutable access to trade… and 2 more (compare)

  • Feb 07 23:22

    mosra on next

    python: add a dedicated test fo… python: expose all index/attrib… python: mutable access to trade… and 2 more (compare)

  • Feb 07 21:17
    vectorsize starred mosra/magnum
  • Feb 07 19:12
    bqqbarbhg synchronize #136
  • Feb 07 18:56
    bqqbarbhg synchronize #136
  • Feb 07 18:39
    bqqbarbhg synchronize #136
  • Feb 07 18:09
    bqqbarbhg synchronize #136
  • Feb 07 18:06
    bqqbarbhg synchronize #136
pezcode
@pezcode
mirrors are 100% specular reflection, virtually no subsurface scattering
Mathew
@lectroMathew

I guess you can say that mirrors are not shine because they don't have any specular highlight

That quote says the opposite, doesn't it? Mirror-like = large shininess

Is what I think as well, but read further:

When this constant is large the specular highlight is small

shininess value of 0.0f results in perfect mirror-like look
pezcode
@pezcode
highlight size is (very loosely speaking) inversely proportional to the amount specular reflection
shiny surface -> small highlight
Mathew
@lectroMathew
Yeah, I guess it does make sense if you think about it
Vladimír Vondruš
@mosra

could anybody on Windows run the following and tell me if it all passes or mostly fails? it all passes for me on Linux with both Chrome and FF, but on the Windows machine I tested on it was about 40 failures and I don't know why :D

https://tmp.magnum.graphics/GLMeshGLTest.html

9 replies
i only wanted to fix that one ANGLE bug, but apparently there's a bottomless pit full of bugs, again
Visage
@Azvf
Hi, I'm trying to blit a framebuffer to the right half of the defaultframebuffer, but why the right half keeps thrashing when I scale the window in width. It seems the resize function problem but it works fine when I use the 'default' blit.
Visage
@Azvf
It keeps switching between the black screen of the defaultframebuffer and the data in the source framebuffer
Vladimír Vondruš
@mosra
huh
the buffer you blit from gets resized as well?
Visage
@Azvf
yes
Visage
@Azvf
        _size = size;
        auto halfSize = Vector2i{ size.x() / 2, size.y() };
        auto& bufferGroup = _bufferGroup[index];

        // RenderBuffer Resize
        bufferGroup.colorBuffer = GL::Renderbuffer{};
        bufferGroup.depthStencilBuffer = GL::Renderbuffer{};
        bufferGroup.colorBuffer.setStorageMultisample(GL::Renderbuffer::maxSamples(), GL::RenderbufferFormat::RGBA8, halfSize);
        bufferGroup.depthStencilBuffer.setStorageMultisample(GL::Renderbuffer::maxSamples(), GL::RenderbufferFormat::Depth24Stencil8, halfSize);

        // MSAA Framebuffer Resize
        bufferGroup.framebufferMSAA = GL::Framebuffer{ { {}, halfSize }};
        bufferGroup.framebufferMSAA
            .attachRenderbuffer(GL::Framebuffer::ColorAttachment{ 0 }, bufferGroup.colorBuffer)
            .attachRenderbuffer(GL::Framebuffer::BufferAttachment::DepthStencil, bufferGroup.depthStencilBuffer)
            .mapForDraw({ {Shaders::PhongGL::ColorOutput, GL::Framebuffer::ColorAttachment{0}} });
        bufferGroup.framebufferMSAA.setViewport({ {}, halfSize });


        // camera viewport setting
        _camera.reshape(size, halfSize);
resize code called on glfw viewport change event
Vladimír Vondruš
@mosra

_bufferGroup[index]

multiple buffering, right? could it be that, at the time of a blit right after the resize, it takes the source data from a framebuffer that hasn't been rendered to yet (because it got just recreated after a resize)?

Visage
@Azvf
Is the viewport event async?
Vladimír Vondruš
@mosra
no, everything happens in the same thread
are you multiple buffering? that's the root cause i think
Visage
@Azvf
It's not multiple buffering, it's multiple framebuffer combined on a sole defaultframebuffer
Vladimír Vondruš
@mosra
ah, hmmm
debugging idea -- if you clear those to 0x00ffff_rgbf right after the recreation, does that color appear in the default framebuffer?
or is it still the default black-ish
Visage
@Azvf
do you mean clear the source framebuffer
Vladimír Vondruš
@mosra
yes
in the viewport event, right after you attachRenderbuffer()s to it
Visage
@Azvf
ok
Visage
@Azvf
it's still the same
there's a draw call overwriting the resize result so I commented it out. The result just changed to switching between cyan and black when I scale the window.
Vladimír Vondruš
@mosra
at this point i see the only solution as recording the actual GL calls with renderdoc or apitrace and then inspecting what gets done in each frame

it works fine when I use the 'default' blit.

if i understand correctly what you mean, the default blit is only implicitly passing the size, but it's the same operation underneath so it shouldn't matter

Visage
@Azvf
I'll work on that tomorrow. Appreciate your help!🙏
This line:
Containers::StridedArrayView2D<std::uint32_t> image = images[5];
shouldn't it say images[4]?
Vladimír Vondruš
@mosra
what the hell, the whole section seems cursed
what did i do there
but yeah, it should be [4]
fixing
pezcode
@pezcode
Related question: how do I get 2D z-slices of a 3D array?
const auto slice0 = image->pixels<Color4ub>().prefix<2>({1, image->size()[1], image->size()[0]});
this is giving me a 2D view with size 27, 1 and I'm not sure what I'm doing
original image is 63, 27,3 and I want 63, 27
Vladimír Vondruš
@mosra
huh, why is Z last?
usually it's Z first, then Y then X
so a 2D Z slice is simply pixels<T>()[i]
pezcode
@pezcode
oh dear, you're right
Vladimír Vondruš
@mosra
in other words, for the pixels view the strided array view size should be image.size().flipped() :)
to answer your original question, if Z would really be last then pixels<T>().transposed<0, 2>()[i], where the transpose turns it from XYZ order to ZYX
pezcode
@pezcode
no you were right, z is the first dimension, I just got really confused in my head
Vladimír Vondruš
@mosra
i made this exact mistake several times myself also, so i learned to spot it :D