Giter Site home page Giter Site logo

Comments (7)

Angelo1211 avatar Angelo1211 commented on July 28, 2024

Hi! Thanks for letting me know of the bug and sharing your error log! I took a look at it and it seems like all the scene data is loading fine, but the issues are located at the renderManager initialization time. To pinpoint the exact location I've added some more print statements to the loading process and pushed those to the source.

There's three things I've thought of so far that we can do to fix this:

  1. Download newBin.zip and replace the contents of the bin folder with the.zip file. This is the compiled version of the small changes I made that add more print statements to the program. If you could re-run and copy the console text in here again that would help me pinpoint further where the issue is.

  2. I've also made the bin a debug version with a pdb file so, If you have visual studio (or some other debugger) you should be able to debug the HybridRenderer.exe file and see in which line it's actually getting stuck on.

  3. If for whatever whatever reason none of the above works either, we'll have to move on to compiling from source and trying to debug that instead. But hopefully this isn't necessary.

Let me know how it goes!

from hybridrenderingengine.

Elabajaba avatar Elabajaba commented on July 28, 2024

It gets stuck Loading Shaders. Running it with the visual studio debugger shows

'hybridRenderer.exe' (Win32): Loaded 'D:\Downloads\HRE v0.1 Aachen\bin\hybridRenderer.exe'. Symbols loaded.
...
Exception thrown at 0x00007FFC5DFDA388 in hybridRenderer.exe: Microsoft C++ exception: DeadlyImportError at memory location 0x0000002A60B0E198.
The thread 0x374c has exited with code 0 (0x0).
The thread 0x213c has exited with code 0 (0x0).
The thread 0x1bc4 has exited with code 0 (0x0).

Vendor: NVIDIA Corporation
Renderer: GeForce GTX 1080 Ti/PCIe/SSE2
Version: 4.6.0 NVIDIA 416.94

Beginning Scene load, checking scene description file:
../assets/scenes/Sponza.json is a valid file
Loading camera...
Loading models...
../assets/models/Sponza/Sponza.gltf is a valid file
Loading skybox...
Loading lights...
Loading directional light...
Loading point light...
Generating environment maps...
Reticulating splines...
Loading Complete!...

Initializing Renderer.
Loading FBO's...
Loading Shaders...

Cloned and ran the repo in vs, "Exception thrown at 0x00007FFC5DFDA388 in hybridRenderer.exe: Microsoft C++ exception: DeadlyImportError at memory location 0x0000008B18B7DDF8." seems to happen in model.cpp line 18 "const aiScene *scene = importer.ReadFile(path, aiProcess_Triangulate | aiProcess_OptimizeMeshes |aiProcess_CalcTangentSpace | aiProcess_FlipUVs);" when loading Sponza, but doesn't cause the program to hang.

Stepping through the shaders it gets to clusterCullLightShader.comp in shader.cpp line 191 "glGetProgramiv(ID, GL_LINK_STATUS, &success);" and then it starts to hang. This is also where the "The thread 0x... has exited with code 0 (0x0). starts, as well as the cpu usage spikes from 9% to 17% and memory usage doubles from ~600MB to 1.2GB in debug build.

from hybridrenderingengine.

Angelo1211 avatar Angelo1211 commented on July 28, 2024

Yeah, the first exception is a normal part of Assimp since it uses throw/catch loops to load GLTF 2.0 files.

Regarding the second part, I'm not sure yet what might be causing the GL_LINK_STATUS call to be acting up like that. I'll ask around to see if I can find a way to borrow a 1080ti for testing. In the meantime, there are two things you could do to help me pinpoint the issue some more:

  1. Somewhere in the rendermanager startup code (before shader loading) can you stick a HRE::printComputeSizes(); call and paste here the results? Although I don't think this will be the issue, I want to rule out any possible compute shader layout incompatibilities by taking a look at your cards max work-group sizes.

  2. Since you already have vs debugging setup, could you take a screenshot of your locals tab? Mine looks like this:
    image

What I'm looking for here is to see if the cShaderCode and the computeCode variables actually loaded correctly.

from hybridrenderingengine.

Elabajaba avatar Elabajaba commented on July 28, 2024

HREUtils::printComputeSizes(); output:

max global (total) work group size x:2147483647 y:65535 z:65535
max local (in one shader) work group sizes x:1536 y:1024 z:64

image

from hybridrenderingengine.

SirKnightTG avatar SirKnightTG commented on July 28, 2024

This is a driver bug.

NVIDIA is looking into it.

from hybridrenderingengine.

Angelo1211 avatar Angelo1211 commented on July 28, 2024

@SirKnightTG If that's the case I'll close the issue for now.

from hybridrenderingengine.

shakesoda avatar shakesoda commented on July 28, 2024

i know this issue is marked closed, but i ran into it and put some time into finding a workaround anyway.

this is the source of the lockup: https://github.com/Angelo1211/HybridRenderingEngine/blob/master/assets/shaders/ComputeShaders/clusterCullLightShader.comp#L115-L120

changing to this worked for me, since it seems nvidia's glsl compiler doesn't like indexing into vecs dynamically with array syntax.

float checkAxis(float tmin, float tmax, float v) {
    if (v < tmin) {
        return (tmin - v) * (tmin - v);
    }
    if (v > tmax) {
        return (v - tmax) * (v - tmax);
    }
    return 0.0;
}

float sqDistPointAABB(vec3 point, uint tile){
    float sqDist = 0.0;
    VolumeTileAABB currentCell = cluster[tile];
    cluster[tile].maxPoint[3] = tile;
    sqDist += checkAxis(currentCell.minPoint.x, currentCell.maxPoint.x, point.x);
    sqDist += checkAxis(currentCell.minPoint.y, currentCell.maxPoint.y, point.y);
    sqDist += checkAxis(currentCell.minPoint.z, currentCell.maxPoint.z, point.z);
    return sqDist;
}

...then, with that sorted out, https://github.com/Angelo1211/HybridRenderingEngine/blob/master/assets/shaders/PBRClusteredShader.frag#L213 needs to be changed to FragColor = vec4(colors[uint(mod(zTile, 8))], 1.0); to compile.

the shadows don't seem to be working, but at least it renders without crashes now 👍

from hybridrenderingengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.