Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:04
    mosra edited #525
  • 15:58
    mosra labeled #525
  • 15:37
    mosra edited #525
  • 15:17
    Build #1561 passed
  • 15:07
    mosra synchronize #525
  • 15:07

    mosra on scenedata

    Trade: use 64-bit values in obj… Trade: make AnimationData objec… Trade: bump AbstractImporter in… and 1 more (compare)

  • 14:49
    mosra edited #525
  • 14:33
    mosra synchronize #525
  • 14:33

    mosra on scenedata

    Trade: preserve field flags in … sceneconverter: print scene fie… Trade: allow omitting implicit … and 5 more (compare)

  • 13:23

    mosra on scenedata

    {Cgltf,TinyGltf}Importer: port … PrimitiveImporter: port to the … OpenGexImporter: port to the ne… and 13 more (compare)

  • 13:23
    mosra synchronize #525
  • 13:23

    mosra on scenedata

    Trade: process SceneData to sin… Trade: ensure newly added objec… Trade: the compatibility defaul… and 20 more (compare)

  • 12:31

    mosra on master

    AssimpImporter: unreferenced te… {Assimp,Cgltf,TinyGltf}Importer… CgltfImporter: fix scene childr… (compare)

  • 11:54

    mosra on next

    AssimpImporter: unreferenced te… {Assimp,Cgltf,TinyGltf}Importer… CgltfImporter: fix scene childr… (compare)

  • 00:44
    mosra edited #525
  • 00:34
    mosra edited #525
  • 00:30
    mosra edited #525
  • 00:30
    mosra edited #525
  • 00:29
    mosra synchronize #525
  • 00:29

    mosra on scenedata

    Trade: add a parentFor() object… Trade: support storing pointers… Trade: introduce SceneData::is2… and 35 more (compare)

Vladimír Vondruš
@mosra

FYI recent Magnum update tightened assertions on Quaternion::fromMatrix(), which requires the matrix to be a proper rotation (before it allowed reflections, but resulted in broken output): mosra/magnum@3697125

if your code starts failing on this new assert and you think it shouldn't, please let me know :)

Fo Nz
@FoNz99089892_twitter

what error do you get?

My bad. I was expecting corrade-rc while compiling for iOS. Excuse me.

Jean-Marie Baran
@Jim-Bar
Hi there, quick question. Do we agree that if I want to do shadow mapping I must drop the PhongGL shader altogether and write my own? Kind of newb on all this shader stuff
pezcode
@pezcode

Hi there, quick question. Do we agree that if I want to do shadow mapping I must drop the PhongGL shader altogether and write my own? Kind of newb on all this shader stuff

Yeah, the shader that calculates lighting needs access to the shadow maps, and PhongGL has no built-in shadow map support.

The shadow mapping example might help you get started:
https://doc.magnum.graphics/magnum/examples-shadows.html
Jean-Marie Baran
@Jim-Bar
Okay, thanks for your answer
hsdk123
@hsdk123
image.png

Hi all, I'm attempting to overlay 2 textures to create 1 texture through the frame buffer.
The result in an image program is the above,
while the frame buffer overlay method I'm using is the below.

I wasn't sure why I'm getting the difference, would anyone understand?

face.png
base.png
(overlay face on base)
I'm using alpha blending when overlaying the textures
Vladimír Vondruš
@mosra
alpha blending is always a trial&error for me :sweat_smile:
what is your clear color set to?
the greyish background above indicates transparency? or is it really just grey
hsdk123
@hsdk123
The grey colour's just the clear colour for the window
The frame buffer that I'm rendering the 2 textures to clears with (0,0,0,0)
Vladimír Vondruš
@mosra
hm there was this neat online tool for figuring out alpha modes somewhere, let me find it
hsdk123
@hsdk123

https://gist.github.com/hsdk123/7f66ecf92d8f51ffaa3e4ac241d4682f

Here's a copy of my code if it shows anything

Vladimír Vondruš
@mosra
are you setting Renderer::setBlendFunction somewhere? i can't see that
what is documented there is one way, you might need some other way depending on whether the images have premultiplied alpha or not, and the tool could help figure out the parameters
hsdk123
@hsdk123
Yeah, it's in
void lvn::CRenderMgr::ApplyBlendMode(const BlendMode& new_mode)
{
    using namespace Magnum;
    static bool init = false;
    static BlendMode cache = BlendMode::BlendAlpha;

    if (!init) {
        GL::Renderer::enable(GL::Renderer::Feature::Blending);
    }
    if (!init || cache != new_mode) {
        GL::Renderer::setBlendFunction(
            static_cast<GL::Renderer::BlendFunction>(new_mode.rgbSrcFactor),
            static_cast<GL::Renderer::BlendFunction>(new_mode.rgbDstFactor),
            static_cast<GL::Renderer::BlendFunction>(new_mode.alphaSrcFactor),
            static_cast<GL::Renderer::BlendFunction>(new_mode.alphaDstFactor)
        );
        GL::Renderer::setBlendEquation(
            static_cast<GL::Renderer::BlendEquation>(new_mode.rgbEquation),
            static_cast<GL::Renderer::BlendEquation>(new_mode.alphaEquation)
        );

        cache = new_mode;
    }

    init = true;
}
Vladimír Vondruš
@mosra
ah i see, sorry, did a lazy search and it didn't find Renderer .. now i see it :)
hsdk123
@hsdk123
No problem, I'm sorry I couldn't clean up the code more
Vladimír Vondruš
@mosra
how does it look if you use One / OneMinusSourceAlpha for both RGB and Alpha?
hsdk123
@hsdk123
image.png
Bright white
Jordan Peck
@Auburn
WSL2 has hardware accelerated GUI support in Windows 11 :O
Guillaume Jacquemin
@williamjcm
I'm personally not too thrilled about Windows 11, to be honest.
By the time Windows 10 goes out of support, I'm sure Linux will run pretty much everything I run on Windows, either natively or through Wine/Proton.
Vladimír Vondruš
@mosra
@hsdk123 sorry, had to leave early yesterday .. this looks closer to the ideal, what's special about the bottom row that it gets treated differently? can you also try SourceAlpha / OneMinusSourceAlpha?
Fo Nz
@FoNz99089892_twitter

image.png

This could be a blending function mistake. It happened to me. If you are working on 2D (for GUI, to say...), disable depth test and clear on RGB channels.

hsdk123
@hsdk123

@mosra

what's special about the bottom row

The bottom row, for both images, is semi-transparent. I think that's what's causing it

hsdk123
@hsdk123
image.png
SourceAlpha / OneMinusSourceAlpha
@FoNz99089892_twitter
I was so hoping disabling depth test would work, but sadly it didn't. Any other ideas?
hsdk123
@hsdk123
@mosra
I'm using One Zero to overlay the first texture on to the frame buffer - would this be incorrect?
Vladimír Vondruš
@mosra
i have no better suggestion than loading the two textures in https://www.andersriggelsen.dk/glblendfunc.php and doing trial&error until it does the right thing
Igal Alkon
@alkavan

I'm having some trouble drawing multiple lines in 3D space. In Drawable3D::draw() have this:

_buffer.setData(_lines, GL::BufferUsage::StreamDraw);
_mesh.setCount(_lines.size());

I added 4 points to the _lines vector, but only two (one line) is drawn. GL::BufferUsage::StreamDraw is not the way?

Hans Loeblich
@thehans
Is there documentation on how to get started with a user-defined shader? I think I was reading such a page the other day, but can't find it now. The overall organization of the docs is very confusing to me.
Guillaume Jacquemin
@williamjcm
IMO, the best documentation is the textured triangle example.
It'll only show the Magnum way of using a custom shader, though, so if you need help writing the actual shader code, there are other resources for that.
Hans Loeblich
@thehans
ok, I'll review that one, thanks. 2nd question, just curious is there a list of projects which use Magnum?
I think i've got the GLSL aspect of it covered, no worries.
Guillaume Jacquemin
@williamjcm

2nd question, just curious is there a list of projects which use Magnum?

I don't remember seeing one of these on the website itself, but the blog post announcing the 2020.06 release mentions a few of them, and other posts might mention more.

Vladimír Vondruš
@mosra

@alkavan how did you add the vertex buffer to the mesh? how are the attributes set up? for example, if the mesh would expect a position and a normal (for whatever reasons) for every vertex but you specify just positions, then it ends up looking at just half of the points

the BufferUsage has nothing to do with this, it's merely a suggestion to the driver where to best put the memory

Igal Alkon
@alkavan
@mosra I already found the issue, kind of stupid. It all worked actually, the issue was I also have a wireframe grid, at y=0.0 and the other lines I added were exactly where grid is and so I didn't see them :)
Vladimír Vondruš
@mosra
ahah :)