Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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)

  • Jan 23 12:08
    jvannugteren commented #94
pezcode
@pezcode
most of them seem to need additions to MaterialAttribute, like IOR or transmission
sheen was the only one I saw that can be done with a layer (color + roughness)
Vladimír Vondruš
@mosra
yep, MaterialAttribute / MaterialLayer additions mostly
the thinfilm extension looked like a good candidate for a layer as well
pezcode
@pezcode
I've only looked at the released ones so far... is thin film for iridescence?
Vladimír Vondruš
@mosra
i don't remember where i saw the example renders (autodesk standard surface maybe? filament?) but thinfilm was for the green/blue tint that's on well-treated leather chairs
iridescence is an extension on its own i think
Vladimír Vondruš
@mosra
ah... KhronosGroup/glTF#2027 , which replaces the thinfilm extension
that explains why i thought it's two separate things
i'm a forever pbr noob
pezcode
@pezcode
they're moving really fast with these extensions, but no visible results
Vladimír Vondruš
@mosra
and yeah those pictures on that link are maybe exactly what i remember

no visible results

i already saw a dataset that used like 10 of those fancy new extensions

pezcode
@pezcode
what I meant is that they have like 10 in the pipeline that aren't finished, but keep changing names and feature sets, only confusing everyone
Vladimír Vondruš
@mosra
ah :) yeah, true
though honestly i like this better than a total silence for 5 years and then "here's glTF 2.1 with PBR Next, enjoy!" with no community involvement
i imagine this is how the internal vulkan extension development looks like as well, only we don't see it :D
pezcode
@pezcode
yeah, this is probably the better alternative
Vladimír Vondruš
@mosra
I just made a commit ccccc9d9281f779b59ff587568fe4f869dab9eb3, does that already count as a mined cryptocurrency or do I need more cs?
pezcode
@pezcode
don't give Microsoft ideas :eyes:
Vladimír Vondruš
@mosra
you mean further gamification of github? :D
Mathew
@lectroMathew
mining on git commits would be the cleanest way to ensure that github's servers go down as quickly as possible and never go up again
Fo Nz
@FoNz99089892_twitter

so myOwnDefaultFramebuffer has a non-zero ID, right? just double-checking i understand this properly

Exactly. Both "default" framebuffer and "default" renderbuffer have a ID of 1, in my case.

irfna
@irfna

Hey, I'm having some issues rendering some basic textured cubes that use the same texture for each side, I end up with weird artifacts that change with every tiny change in the camera angle:

https://i.imgur.com/VH6HOuG.png

Currently using phong shader to test but the FlatGL shader has the same problem. My current vertices are just a copy and paste/rename of cubeSolid() and its dependencies, except I shoved in texture coordinates:

constexpr struct TileBlockVertex2 {
    Vector3 position;
    Vector3 normal;
    Vector2 textureCoordinates;
} TileBlockVertices2[]{
    {{-1.0f, -1.0f,  1.0f}, { 0.0f,  0.0f,  1.0f}, { 0.0f,  0.0f}},
    {{ 1.0f, -1.0f,  1.0f}, { 0.0f,  0.0f,  1.0f}, { 1.0f,  0.0f}},
    {{ 1.0f,  1.0f,  1.0f}, { 0.0f,  0.0f,  1.0f}, { 1.0f,  1.0f}}, /* +Z */
    {{-1.0f,  1.0f,  1.0f}, { 0.0f,  0.0f,  1.0f}, { 0.0f,  1.0f}},

...

And so on, then I'm just using cubeSolid() as is shown in examples. When I test FlatGL, I have a version of the array without the normal vector in it but is otherwise the same. There has to be something small/dumb I'm not seeing that is resulting in these errors, but everything I'm attempting is failing

Vladimír Vondruš
@mosra
hi! could it be just .. the depth test not being enabled?
leading to the (black) backfaces sometimes rendered after the faces that should be in front
irfna
@irfna
    GL::defaultFramebuffer.clear(GL::FramebufferClear::Color|GL::FramebufferClear::Depth);

    ViewRegion();

    GL::Renderer::enable(GL::Renderer::Feature::DepthTest);

    sprites.draw(*_camera);
    terrain.draw(*_camera);
I have actually experimented without depth test, but then some sides and other things are randomly missing as well. There's something really wrong that I can't nail down
I've used various textured cube vertex data from random people online to try different versions, but there's always artifacts and bugs in the cube. I'm able to render sprites on planes just fine, so I'm not sure why cubes are being so silly
 Shaders::PhongGL shader{Shaders::PhongGL::Flag::DiffuseTexture};

 GL::Mesh mesh = MeshTools::compile(cubeSolid());
  auto size = Vector3(TilePixelDimensions) / 4.0f;

  category.shader
  .setTransformationMatrix(transformation*Matrix4::scaling(size))
  .setProjectionMatrix(camera.projectionMatrix())
  .bindDiffuseTexture(*texture)
  .draw(category.mesh);
There's nothing really complicated going on in the code either, but maybe I'm missing a necessary feature or something?
Vladimír Vondruš
@mosra
huh
what's your setup? is it just a pure magnum application or combined with some 3rd party lib that could potentially touch OpenGL as well?
irfna
@irfna
This is a pure magnum setup based on the basic bootstrap project, setup just for testing out rendering sprites and cubes
Vladimír Vondruš
@mosra
ah that could be rather easy to go through, can you post the whole code somewhere? gist, pastebin... i'll look at it
the small stupid mistakes are always the most annoying :D
irfna
@irfna
haha ya. Thanks for the help and looking at this! I'm rounding this up, I guess I could just zip it up and post it somewhere? All I've changed are the CMakeLists.txt and MyApplication.cpp of the bootstrap. Let me toss this on google drive or something
The tricky part is that I have it launching in my c:\lib directory where I have my .dll files compiled, but it's grabbing sprites from a different hardcoded directory, so I'm figuring out how to package this together properly
Vladimír Vondruš
@mosra
i'm on linux anyway, so i'll just grab the code and see :)
even just the cpp file is enough
irfna
@irfna

https://pastebin.com/15p7G9B8

Ok, this is just the cpp file, I have imagepath at the top to be filled out with an image path, and can grab my really poorly drawn images as well

I changed it to using flatGL instead of phong in the mean time, so it will be using the flat shader in the pastebin, the error is clearer with it though I think
Vladimír Vondruš
@mosra
hmmm i get the same issue
investigating...
irfna
@irfna
I really appreciate the help!
Vladimír Vondruš
@mosra

btw, i find this hilariuous:

GetImage("dirt.png")

vs

GetImage(object.png)

had to take a double look until i understood how it can even compile :D

irfna
@irfna
hahaha oops ya I should have fixed that debug output, I was copying and pasting example code
This is more of a test run of various features I need than making the actual game proper
Vladimír Vondruš
@mosra

okay the problem seems to be here:

.setProjectionMatrix(Matrix4::perspectiveProjection(35.0_degf, 4.0f/3.0f, 0.001f, 1000000.0f))

the near/far range is so huge that it's beyond what can be represented in a (I assume) 24bit depth buffer, and so the cube front and back faces get assigned the same depth value, which makes the output depend on the order the GPU processes the triangles and not the actual depth