diharaw / sdf-baking Goto Github PK
View Code? Open in Web Editor NEWAn OpenGL sample that demonstrates baking SDFs and using them to add Soft Shadows and Ambient Occlusion to a rasterized scene.
License: MIT License
An OpenGL sample that demonstrates baking SDFs and using them to add Soft Shadows and Ambient Occlusion to a rasterized scene.
License: MIT License
I've had a few problems getting this to compile with VS 2022 on Windows 10 and I've worked through them, but I wanted to document them for you.
First, it might be worth noting in the README that VS 2022 apparently needs to be told explicitly to install the following, under "Tools" -> "Get Tools and Features" :
Dependencies fail to compile because "WIN32" is not defined (i.e. if defined(WIN32)
and #ifdef WIN32
return false). I just slapped add_definitions(-DWIN32)
into CMakeLists.txt
but I imagine there's a proper way to fix this.
The build failed without the /EHsc
flag. I ended up building with:
cmake -DCMAKE_CXX_FLAGS="/EHsc" -G "Visual Studio 17 2022" ..
In main.cpp
, this line kept it from compiling:
m_bake_sdf_program->set_uniform("u_VolumeSize", volume_size);
There was no suitable overload for set_uniform
in dwSampleFramework.
I declared this (in dwSampleFramework) in ogl.h
:
bool set_uniform(std::string name, glm::ivec3 value);
and defined this in olg.cpp
:
bool Program::set_uniform(std::string name, glm::ivec3 value)
{
if (m_location_map.find(name) == m_location_map.end())
return false;
glUniform3i(m_location_map[name], value.x, value.y, value.z);
return true;
}
Everything looks fine now. Thanks for sharing this example.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.