Coder Social home page Coder Social logo

jbikker / lighthouse2 Goto Github PK

View Code? Open in Web Editor NEW
812.0 812.0 81.0 622.8 MB

Lighthouse 2 framework for real-time ray tracing

License: Other

C++ 63.94% C 34.30% GLSL 0.36% Batchfile 0.04% Cuda 0.64% Objective-C 0.11% Lua 0.27% Python 0.28% CMake 0.04% HTML 0.02%
cuda cuda-opengl denoising game-engine gamedev glfw gltf gltf-viewer gpu opengl optix path-tracing raytracer real-time render rendering rendering-engine rendersystem rtx svgf

lighthouse2's Issues

Error when running on Maxwell card

Hello,

I get the following error when trying to run the imguiapp application on a 750Ti

RenderCore_OptixPrime_B core:
image

RenderCore_Optix7 Core:
image

The last commit that is working for me is: c5e0ab5

Broken RenderCore_Minimal

The render function in RenderCore_Minimal contains an incorrect call to glTexSubImage2D:

glTexSubImage2D( GL_TEXTURE_2D, 0, GL_RGBA, screen->width, screen->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, screen->pixels );

Based on the docs, the call signature is

void glTexSubImage2D(GLenum target,
                     GLint level,
                     GLint xoffset,
                     GLint yoffset,
                     GLsizei width,
                     GLsizei height,
                     GLenum format,
                     GLenum type,
                     const void * pixels);

and as such the call itself should be:

glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, screen->width, screen->height, GL_RGBA, GL_UNSIGNED_BYTE, screen->pixels );

OpenGL Error Invalid Operation

I am just starting out with lighthouse2 trying to compile it on my laptop.
glGetError() in CheckGL() seems to be giving me INVALID_OPERATION

Could you please have a look at lines 118 - 120 in platform.cpp
glBindVertexArray( 0 );
glDisableVertexAttribArray( 0 );
glDisableVertexAttribArray( 1 );

I think there is something wrong.

OpenGL reference says:
"GL_INVALID_OPERATION is generated by glEnableVertexAttribArray and glDisableVertexAttribArray if no vertex array object is bound."
But we are unbinding the vertex array object in glBindVertexArray(0) with the argument zero so there is no vao bound. Or did I get something wrong here?

Which CUDA?

Hello,

I am researching real-time ray tracing for a project that I am working on to update an older SDL2/OpenGL 3D game to a modern renderer and would definitely like to see if I could rework the project to have a real-time ray tracer instead along with some other modern rendering features.

In as much, I came across your lighthouse2 project and it says to use CUDA 11.7 but I was wondering if it would build and run with the latest CUDA 12.0 as well?

Sorry, but I am a bit new to CUDA and have also been investigating Vulkan to learn more about it as well.

Any help would be greatly appreciated.
Thanks

NaN in PackNormal compression

Hi Jacco,

The function

// from: https://aras-p.info/texts/CompactNormalStorage.html
LH2_DEVFUNC uint PackNormal( float3 N )
{
#if 1
	// more efficient
	const float f = 65535.0f / sqrtf( 8.0f * N.z + 8.0f );
	return (uint)(N.x * f + 32767.0f) + ((uint)(N.y * f + 32767.0f) << 16);
#else
	float2 enc = normalize( make_float2( N ) ) * (sqrtf( -N.z * 0.5f + 0.5f ));
	enc = enc * 0.5f + 0.5f;
	return (uint)(enc.x * 65535.0f) + ((uint)(enc.y * 65535.0f) << 16);
#endif
}

Produces a NaN for input normal (0, 0, -1) which leads to a return value of 0.
Unpacking the 0 value leads to a NaN normal.

I solved the problem I had by adding a max check with an Epsilon of 0.0001f:

const float f = 65535.0f / fmaxf(sqrtf(8.0f * normal.z + 8.0f), 0.0001f);

I was running this code on CPU, so I'm unsure if this is handled differently on the GPU.

freetype.dll was not found

Running any app results in:
"freetype.ddl was not found"

Apps seems to have the required ddls committed in their respective directories, but freetype.dll is not included it seems?

Thanks

Optix error unsupported ABI version

Hi Jacco,

I followed the instructions to compile Lighthouse with VS2017, however when running the application it shows a fatal error:

running on GPU: GeForce RTX 2060 (30 SMs, 6GB VRAM)

Error at line 124 of c:\users\sam\downloads\lighthouse2-master\lighthouse2-master\lib\rendercore_optix7\rendercore.cpp:
optixInit()
OPTIX_ERROR_UNSUPPORTED_ABI_VERSION (7801)

Googling this error seems to point to an issue with Optix 7. Any help on how to resolve it is appreciated.

Project not building Debug x64

If I try to build the project for the Debug x64 target I get error C2855: command-line option '/Z7' inconsistent with precompiled header.
In Release x64 mode I don't get this error and it builds fine.

The issue seems to be caused by the latest commit (e0ed8c3). If I go back to any previous commit it does build.

Correct CUDA Version?

Readme says 10.1 is required but the troubleshooting page says 10.2. Not sure if it works on both but just wanted to mention this.

Error building the pbrtdemoapp

Camera has no position or direction members...

5>D:\lighthouse2\apps\pbrtdemoapp\main.cpp(189,51): error C2039: 'position': is not a member of 'lighthouse2::Camera'
5>D:\lighthouse2\lib\RenderSystem\camera.h(25): message : see declaration of 'lighthouse2::Camera'
5>D:\lighthouse2\apps\pbrtdemoapp\main.cpp(190,52): error C2039: 'direction': is not a member of 'lighthouse2::Camera'
5>D:\lighthouse2\lib\RenderSystem\camera.h(25): message : see declaration of 'lighthouse2::Camera'
5>Done building project "pbrtdemoapp.vcxproj" -- FAILED.

help shadows optix7

Hi!
i have imported a gltf file, but i am not able to cast the inner shadows, i have spend 2 days trying to figure out why, the renderer i use is "RenderCore_Optix7"
here is the screenshot:
optix7
my graphis card is a nvidia quadro p4000, with latest drivers and cuda 10.2

on the other hand i can cast inner shadows with renderer "RenderCore_OptixPrime_BDPT"
notoptix

the gltf source file is here:
scene.zip

and it shows correctly with online gtlf view from
https://pissang.github.io/clay-viewer/editor/
wood1

any idea what i am doing wrong there ? thx

Optix Prime renders incorrectly (black) on Titan V (Volta)..

Some things I found trying to fix:
*Included Optix prime DLL&lib version is 5.1 so I updated to 6.0:

//#pragma comment(lib, "../OptiX/lib64/optix_prime.1.lib" )
#pragma comment(lib, "../OptiX/lib64/optix_prime.6.0.0.lib" )

now shows correctly:

running on GPU: TITAN V (80 SMs, 12GB VRAM)
OptiX Version:[6.0.0] Branch:[rel6.0] Build Number:[25650775] CUDA Version:[10.1] 64-bit 2019-01-29

*changed .cuda.cu files device support from :
compute_50,sm_50;compute_75,sm_75
to:
compute_70,sm_70;compute_75,sm_75
*I found some :

#if __CUDA_ARCH__ > 700
#define THREADMASK	__activemask() // volta, turing
#else
#define THREADMASK	0xffffffff // pascal, kepler, fermi
#endif

and changed:
#if __CUDA_ARCH__ > 700
to:
#if __CUDA_ARCH__ >= 700
to include Volta..
still black screen..

Note I also cleaned .cu.ptx file in case..
I'm using NV VK dev driver from 418 branch and CUDA 10.1 Update 1 SDK..
maybe fixed with original CUDA 10.1 SDK and/or NV 430.xx driver?
thanks..

normal maps, mdl materials

i am leaving my comments here since its not possible to register new users to ompf2 forums

  • i have been using lighthouse2 with simple models gltf with normals maps, can you let us know if this is functional in lighthouse2 ?
  • would it be possible to implement MDL nvidia materials, are you planning this on your roadmap ?
    thx

Create DOI for the repository

I wanted to ask if you considered to create a DOI for the lighthouse2 framework. This allows researchers to reference a version of the framework with ease and can be done with Zenodo for example. There is also great integration between Zenodo, which creates a new DOI and a persistent copy of the repository for each release, and Github. You can find instructions on how to create a DOI here from official Github docs: https://docs.github.com/en/repositories/archiving-a-github-repository/referencing-and-citing-content

On a similar note, it also helps researchers to know how to correctly cite the software. Github utilizes the citation file format which was designed for software specifically. You can find more information about it here: https://citation-file-format.github.io/
I would be happy to help with this if you have any questions.

vulkan compile error

Hi, using visual studio 2017 and compiling the vulkan rendercore i got this error:

Severity Code Description Project File Line Suppression State
Error C2280 'lh2core::VulkanShader::VulkanShader(const lh2core::VulkanShader &)': attempting to reference a deleted function rendercore_vulkan_rt lighthouse2-master\lib\rendercore_vulkan_rt\rendercore.cpp 234

and breaks at line 234:
auto rgenShader = VulkanShader( m_Device, "rt_shaders.rgen" );

any info on this ? thx

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.