Where communities thrive


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

    mosra on next

    modules: Glslang, you're the re… (compare)

  • 22:24

    mosra on next

    modules: Glslang, you're the re… (compare)

  • 22:14

    mosra on next

    SpirvToolsShaderConverter: drop… SpirvToolsShaderConverter: adap… modules: Glslang, you're the re… (compare)

  • 21:42
    Build #1368 passed
  • 21:09

    mosra on next

    OpenExr{Importer,ImageConverter… (compare)

  • 21:07
    mosra commented #522
  • 20:47
    mosra milestoned #522
  • 20:26
    mosra edited #91
  • 20:25
    mosra edited #91
  • 19:59
    mosra milestoned #97
  • 19:22
    mosra milestoned #91
  • 19:22
    mosra edited #91
  • 15:39
    diwant commented #522
  • 15:39
    diwant edited #522
  • 15:19
    diwant commented #522
  • 15:16
    diwant opened #522
  • Jun 18 22:21
    pezcode commented #97
  • Jun 18 22:12
    pezcode opened #97
  • Jun 18 21:54

    mosra on next

    OpenExr{Importer,ImageConverter… (compare)

  • Jun 18 21:19

    mosra on next

    OpenExr{Importer,ImageConverter… (compare)

Guillaume Jacquemin
@williamjcm

On an unrelated note, Electronic Arts GPL'd the code of the first two Command & Conquer games (Tiberian Dawn and Red Alert) used in the soon-to-be-released Command & Conquer Remastered Collection.

Here's the link: https://github.com/electronicarts/CnC_Remastered_Collection

It's interesting to read, but the formatting in some files hurts my eyes (REDALERT/DLLInterface.h is an example).

DaeMon87
@DaeMon87
Just a question on loading the magnum plugins, I am trying to include the StbTrueTypeFont plugin but the plugin manager does not seem to find the plugin when I call load or loadAndInstantiate, it seems to be looking in the correct directory and I have these files in that directory ('StbTrueTypeFont.conf', 'StbTrueTypeFont.dll', 'StbTrueTypeFont.exp', 'StbTrueTypeFont.lib') is there any file missing that I need? or am I missing a step to load the plugin correctly.
PluginManager::Manager<Trade::AbstractImporter> importerManager;
PluginManager::Manager<Text::AbstractFont> fontManager;
m_spFont = fontManager.loadAndInstantiate("StbTrueTypeFont");
if (!m_spFont || !m_spFont->openFile("SourceSansPro-Regular.ttf", 16.0f)) {

    Corrade::Utility::Fatal{} << "Cannot open font file";
}
Tracy Ma
@linuxaged

@mosra fail to read depth buffer when running with WebGL2(EmscriptenApplication + WASM):

Float MouseInteractionExample::depthAt(const Vector2i& windowPosition) {
    /* First scale the position from being relative to window size to being
       relative to framebuffer size as those two can be different on HiDPI
       systems */
    const Vector2i position = windowPosition * Vector2{framebufferSize()} / Vector2{windowSize()};
    const Vector2i fbPosition{position.x(), GL::defaultFramebuffer.viewport().sizeY() - position.y() - 1};
#ifndef CORRADE_TARGET_EMSCRIPTEN
    GL::defaultFramebuffer.mapForRead(GL::DefaultFramebuffer::ReadAttachment::Front);
#endif
    Image2D data = GL::defaultFramebuffer.read(
        Range2Di::fromSize(fbPosition, Vector2i{1}).padded(Vector2i{2}),
        {GL::PixelFormat::DepthComponent, GL::PixelType::Float});

    return Math::min<Float>(Containers::arrayCast<const Float>(data.data()));
}

mapForRead is not called when target EMSCRIPTEN, is this related?

@DaeMon87 have you installed the plugin? vcpkg install magnum-plugins[stbtruetypefont] --triplet x86-windows
DaeMon87
@DaeMon87
@linuxaged no I am manually building everything. I am adding magnum to an existing project that does not use cmake, so I have cloned the repos and manually built corrade, magnum and magnum-plugins and I am referencing the libs from my app
Guillaume Jacquemin
@williamjcm
Are you sure the plugins are in the right folder ?
For font importers, the right folder is magnum/fonts (or magnum-d for debug builds of Corrade/Magnum).
DaeMon87
@DaeMon87

Yes they should be in the correct directory, I used

auto sDir = fontManager.pluginDirectory();

to verify and I also tried manually setting the directory used in case the wrong slash made a difference but the loadAndInstantiate call is always returning null

Vladimír Vondruš
@mosra
wow this is like a week worth of messages compressed into six hours :D
@DaeMon87 are you using current master or the 2019.10 release?
if it doesn't find the plugin, it prints a message to the standard output, can you post it here? what does fontManager.pluginList() print?
Vladimír Vondruš
@mosra
@AndySomogyi about the Screen conflict, is it possible that you have using namespace Magnum::Platform somewhere? that could cause this ... otherwise this shouldn't happen, as Screen is always unambiguous
@linuxaged what's exactly not working when reading depth? do you get a GL error? which browser is this? i remember i had to do a very nasty workaround to make this work on firefox
Tracy Ma
@linuxaged
depthAt()always return 0
And a warning: WebGL warning: readPixels: Unexpected format or type.
Vladimír Vondruš
@mosra
browser?
Tracy Ma
@linuxaged
the warning from javascript:
GLctx.readPixels(x,y,width,height,format,type,pixels)
Firefox 70
Vladimír Vondruš
@mosra
yeah, FF, that's the problematic one :/
let me dig up the messy code i had to use
Tracy Ma
@linuxaged
sorry, Firefox 76
Tracy Ma
@linuxaged
图片.png
tried in chrome too, the same warning
Vladimír Vondruš
@mosra
huh!
okay wait
if you use UnsignedInt instead of Float, does that work?
Tracy Ma
@linuxaged
not work, both Chrome and Firefox : (
Vladimír Vondruš
@mosra
then i guess your only option is to do what i did on that link above :/
Guillaume Jacquemin
@williamjcm
Just reading the comment in the link is making my head spin.
:dizzy_face:
Vladimír Vondruš
@mosra
@linuxaged as a last attempt, can you try UnsignedShort?
Tracy Ma
@linuxaged
So why the https://magnum.graphics/showcase/mouseinteraction/ example works? i copied code directly from there
Vladimír Vondruš
@mosra
there's two branches, master with what you copied, which is the sane and understandable implementation
and then ports, from where is the above link, with the insane crazy implementation that has to use a shader to read the depth
and that's what is used in this web demo
Tracy Ma
@linuxaged
much more complicated 😓
Vladimír Vondruš
@mosra
yeah, it's terrible :/
Tracy Ma
@linuxaged
UnsignedShort still not work~
Vladimír Vondruš
@mosra
it's just unbelievably stupid, see:
image.png
image.png
you just can't
at all
and as far as i can see, there's no (webgl) extension to allow this either
Tracy Ma
@linuxaged
╮(╯-╰)╭
Vladimír Vondruš
@mosra
the mouseinteraction example is slightly more complicated because of the multisampling, which you could skip if you don't need that, but the main complexity with the shader reading is still there
Janos95
@Janos95
or use an AABB tree and do ray casting. But that's not really simpler :laughing:
Vladimír Vondruš
@mosra
yeah no :D