GithubHelp home page GithubHelp logo

razakhel / raz Goto Github PK

View Code? Open in Web Editor NEW
544.0 17.0 27.0 342.11 MB

Modern & multiplatform 3D game engine in C++17

Home Page: http://razakhel.github.io/RaZ

License: MIT License

CMake 2.37% C++ 95.89% GLSL 1.38% Dockerfile 0.14% GDB 0.01% Python 0.11% Lua 0.11%
rendering 3d-engine c-plus-plus library windows linux opengl cmake c-plus-plus-17 cross-platform

raz's People

Contributors

alexandre-janniaux avatar amelieheinrich avatar devnexen avatar razakhel avatar remqb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raz's Issues

[Cook-Torrance] Investigate UE4's Fresnel Shlick optimization

Instead of the common Fresnel calculation, Brian Karis suggests using a spherical gaussian approximation, which he deems more efficient with unnoticeable differences.

As such, the current Fresnel calculation:

Standard formula

vec3 fresnel = baseReflectivity + (1.0 - baseReflectivity) * pow(1.0 - cosTheta, 5.0);

would become:

Optimization formula

vec3 fresnel = baseReflectivity + (1.0 - baseReflectivity) * pow(2.0, (-5.55473 * cosTheta - 6.98316) * cosTheta);

In RaZ's case, this actually fixes black artifacts when the light's position is strictly equivalent to the camera's (which should not happen in real life cases):

Fresnel artifacts
Fresnel optimization

This optimization should probably be investigated, as the artifacts may come from a small blunder in the implementation.

Problem: GltfLoad.cpp hides data about nodes transformation.

I'm trying to use RaZ in a simulator project.

I need the ability to transform Meshes imported from a Gltf file in Runtime.

For example:

We have a model of a clock:

node1 {transform, mesh} - watch case
node2 {transform, mesh} - hour hand
node3 {transform, mesh} - minutes hand
node4 {transform, mesh} - seconds hand

After exporting the model, you need to be able to:

model.getNodeTransform(node2.name).setRotation(hours_value)
model.getNodeTransform(node2.name).setRotation(minutes_value)
model.getNodeTransform(node2.name).setRotation(seconds_value)

Possible Solution.

In RaZ:

Add two modules: GltfSceneFormat (from GltfLoad.cpp) SceneRenderer (new component).

// GltfSceneFormat.cpp

void loadVertices(...)
{
...
//if (transform.has_value()) {
// for (Vertex& vert : submesh.getVertices()) {
// vert.position = transform->getPosition() + transform->getRotation() * (vert.position * transform->getScale());
// vert.normal = (transform->getRotation() * vert.normal).normalize();
// vert.tangent = (transform->getRotation() * vert.tangent).normalize();
// }
//}
}

std::vector<std::optional> loadTransforms(
SceneRenderer & sceneRenderer,
const std::vectorfastgltf::Node& nodes,
std::size_t meshCount)
{
std::vector<std::optional> transforms;
transforms.resize(meshCount);

for (const fastgltf::Node& node : nodes)
{
Transform transform = loadTransform(node);
sceneRenderer.m_transforms.emplace_back(transform);
//computeNodeTransform(node, std::nullopt, nodes, transforms);
}

return transforms;
}

void loadNodes(SceneRenderer & sceneRenderer, const std::vectorfastgltf::Node& nodes)
{
unsigned long transformIndex = 0;

for (auto & node_ : nodes)
{     
    SceneRenderer::Node node;
    node.name = node_.name.c_str();
    node.transformIndex = transformIndex;
    transformIndex++;
    if (node_.meshIndex.has_value())
        node.meshIndex = node_.meshIndex.value();
    for (auto child : node_.children)
    {
        node.children.emplace_back(child);
    }
    sceneRenderer.m_nodes.emplace_back(node);
}

}

std::pair<Mesh, MeshRenderer> loadMeshes(...)
{
...
Mesh loadedMesh;
MeshRenderer loadedMeshRenderer;
for (const fastgltf::Primitive& primitive : meshes[meshIndex].primitives) {
...
Submesh& submesh = loadedMesh.addSubmesh();
SubmeshRenderer& submeshRenderer = loadedMeshRenderer.addSubmeshRenderer();
...
loadedMeshRenderer.getMaterials().emplace_back(std::move(Material(MaterialType::COOK_TORRANCE)));
...
}
...

}

SceneRenderer load(const FilePath& filePath) {
...
const std::vector<std::optional> transforms = loadTransforms(sceneRenderer, asset->nodes, asset->meshes.size());

loadNodes(sceneRenderer, asset->nodes);

for (auto & node : asset->nodes)
{
if (node.meshIndex.has_value())
{
auto [mesh, meshRenderer] = loadMeshes(asset->meshes, node.meshIndex.value(), asset->buffers, asset->bufferViews, asset->accessors, transforms);
sceneRenderer.m_meshRenderers.emplace_back(std::move(meshRenderer));
}
}

const std::vector<std::optional> images = loadImages(asset->images, asset->buffers, asset->bufferViews, parentPath);

for (auto & meshRenderer : sceneRenderer.m_meshRenderers)
loadMaterials(asset->materials, asset->textures, images, meshRenderer);
...
return sceneRenderer;
}

And:
// RendererSystem.cpp
void RenderSystem::linkEntity(const EntityPtr& entity) {
...
}

void RenderSystem::initialize() {
// add GltfRenderer
registerComponents<Camera, Light, MeshRenderer, SceneRenderer>();
...
// add GltfRenderer
if (entity->hasComponent())
{
auto & gltfrenderer = entity->getComponent();
//for (auto & meshrenderer : gltfrenderer.getMeshRenderers())
for (auto & meshrenderer : gltfrenderer.m_meshRenderers)
updateMaterials(meshrenderer);
}

}

// RenderGph.cpp
void RenderGraph::execute(RenderSystem& renderSystem) {
...

// add GltfRenderer
}
else if (entity->hasComponent())
{
if (!entity->isEnabled() || !entity->hasComponent())
continue;

const auto& gltfRenderer = entity->getComponent<SceneRenderer>();

if (!gltfRenderer.isEnabled())
  continue;
auto m_ = entity->getComponent<Transform>().computeTransformMatrix();
renderSystem.m_modelUbo.sendData(entity->getComponent<Transform>().computeTransformMatrix(), 0);
auto m = entity->getComponent<Transform>().computeTransformMatrix();
gltfRenderer.draw(renderSystem.m_modelUbo, m);

}

In App:

Raz::Entity& clock = world.addEntityWithComponentRaz::Transform();
auto & clockRenderer = clock.addComponentRaz::SceneRenderer(Raz::GltfSceneFormat::load(RAZ_ROOT "assets/watch_case.gltf"));
auto hours = clockRenderer.getTransformNode("hours_hend");
auto minutes = clockRenderer.getTransformNode("hours_hend");
auto seconds = clockRenderer.getTransformNode("hours_hend");

app.run([&] (float deltaTime) {
// get current hours_value, minutes_value, seconds_value
hours.value()->setRotation(hours_value);
minutes.value()->setRotation(minutes_value);
seconds.value()->setRotation(seconds_value);
});

Example implementation in attached files:

This really works.

You are free to use this code as you wish.

Vladimir Razumov.

updatedfiles.zip

[CI] Investigate graphics unit testing under macOS

After having tried many different things, launching unit tests which require graphics capabilities (using GLFW in this case) always fail. It is yet unknown if this is due to:

  • A technical issue of macOS VMs/servers without any available workaround (which doesn't seem like it, since there are reports that it can be done, at least could have been some time ago);
  • Something missing concerning the window's initialization: GLFW may need specific settings to be able to start under those conditions;
  • Specific arguments to launch Xvfb and/or the tests executable with.

See:

Note: Xvfb needs the package xquartz to be installed by brew.

Separate steps

- name: Starting Xvfb
  run: |
    export DISPLAY=:99.0;
    ( sudo /usr/X11/bin/Xvfb :99 -ac -screen 0 1280x720x24 +render +iglx )&

- name: Test
  working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
  run: ALSOFT_DRIVERS=null ./tests/RaZ_Tests
Unable to create basic Accelerated OpenGL renderer.
Unable to create basic Accelerated OpenGL renderer.
Core Image is now using the software OpenGL renderer. This will be slow.
GLFW error 65545: NSGL: Failed to find a suitable pixel format
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Error: Failed to create GLFW Window
/Users/runner/work/_temp/62d6113c-982d-45c8-abf4-0294b9601198.sh: line 1:  2157 Abort trap: 6           ALSOFT_DRIVERS=null ./tests/RaZ_Tests
Error: Process completed with exit code 134.

See:

Single command

- name: Test
  working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
  run: /usr/X11/bin/Xvfb :99 & export DISPLAY=:99 & ALSOFT_DRIVERS=null ./tests/RaZ_Tests
Unable to create basic Accelerated OpenGL renderer.
Unable to create basic Accelerated OpenGL renderer.
Core Image is now using the software OpenGL renderer. This will be slow.
GLFW error 65545: NSGL: Failed to find a suitable pixel format
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Error: Failed to create GLFW Window
/Users/runner/work/_temp/1e2bfa6e-3279-423e-aa75-96161a9cb859.sh: line 1:  2149 Abort trap: 6           ALSOFT_DRIVERS=null ./tests/RaZ_Tests
Error: Process completed with exit code 134.

See:

[Shape] Implement shape point containment, point projection & intersection

Point containment:

  • Line
  • Plane (untested)
  • Sphere
  • Triangle (untested)
  • Quad
  • AABB
  • OBB

Point projection:

  • Line
  • Plane (untested)
  • Sphere (untested)
  • Triangle (untested)
  • Quad
  • AABB (untested)
  • OBB

Intersection:

  • Line-line
  • Line-plane
  • Line-sphere (untested)
  • Line-triangle
  • Line-quad
  • Line-AABB
  • Line-OBB
  • Plane-plane
  • Plane-sphere
  • Plane-triangle
  • Plane-quad
  • Plane-AABB (untested)
  • Plane-OBB
  • Sphere-sphere
  • Sphere-triangle
  • Sphere-quad
  • Sphere-AABB
  • Sphere-OBB
  • Triangle-triangle
  • Triangle-quad
  • Triangle-AABB
  • Triangle-OBB
  • Quad-quad
  • Quad-AABB
  • Quad-OBB
  • AABB-AABB
  • AABB-OBB
  • OBB-OBB

Undefined symbos for sound engine on mac m1 (OpenAL not installed)

Undefined symbols for architecture arm64:
"Raz::Microphone::openDevice(Raz::AudioFormat, unsigned int, float, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
decltype(auto) sol::stack::stack_detail::call<true, 0ul, 1ul, 2ul, 3ul, void, Raz::AudioFormat, unsigned int, float, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, sol::detail::default_construct&, Raz::Microphone* const&>(sol::types, void<Raz::AudioFormat, unsigned int, float, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&>, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul>, lua_State*, int, sol::detail::default_construct&, Raz::Microphone* const&) in libRaZ.a(LuaAudio.cpp.o)
decltype(auto) sol::stack::stack_detail::call<true, 0ul, 1ul, 2ul, void, Raz::AudioFormat, unsigned int, float, sol::detail::default_construct&, Raz::Microphone* const&>(sol::types, void<Raz::AudioFormat, unsigned int, float>, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul>, lua_State*, int, sol::detail::default_construct&, Raz::Microphone* const&) in libRaZ.a(LuaAudio.cpp.o)
Raz::LuaWrapper::registerAudioTypes()::$_1::__invoke(Raz::Microphone&, Raz::AudioFormat, unsigned int, float) in libRaZ.a(LuaAudio.cpp.o)
"Raz::Microphone::recoverDevices()", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Microphone::destroy()", referenced from:
int sol::detail::usertype_alloc_destroyRaz::Microphone(lua_State*) in libRaZ.a(LuaAudio.cpp.o)
"Raz::AudioSystem::openDevice(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
int sol::u_detail::binding<char const*, sol::overload_set<Raz::LuaWrapper::registerAudioTypes()::$_0, void (Raz::AudioSystem::)(std::__1::basic_string<char, std::__1::char_traits, std::_1::allocator > const&)>, Raz::AudioSystem>::call_with<true, false>(lua_State, void*) in libRaZ.a(LuaAudio.cpp.o)
int sol::u_detail::binding<char const*, sol::overload_set<Raz::LuaWrapper::registerAudioTypes()::$_0, void (Raz::AudioSystem::)(std::__1::basic_string<char, std::__1::char_traits, std::_1::allocator > const&)>, Raz::AudioSystem>::call_with<false, false>(lua_State, void*) in libRaZ.a(LuaAudio.cpp.o)
int sol::function_detail::call<sol::function_detail::overloaded_function<0, Raz::LuaWrapper::registerAudioTypes()::$_0, void (Raz::AudioSystem::)(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)>, 2, false>(lua_State) in libRaZ.a(LuaAudio.cpp.o)
"Raz::AudioSystem::recoverDevices()", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::AudioSystem::destroy()", referenced from:
int sol::detail::usertype_alloc_destroyRaz::AudioSystem(lua_State*) in libRaZ.a(LuaAudio.cpp.o)
"Raz::AudioSystem::AudioSystem(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
Raz::AudioSystem& Raz::World::addSystemRaz::AudioSystem() in libRaZ.a(LuaCore.cpp.o)
Raz::AudioSystem& Raz::World::addSystem<Raz::AudioSystem, char const*>(char const*&&) in libRaZ.a(LuaCore.cpp.o)
int sol::call_detail::constructor_match<Raz::AudioSystem, true, true>::operator()<void (), 0ul, void>(sol::types<void ()>, std::__1::integral_constant<unsigned long, 0ul>, sol::types, sol::types<>, lua_State*, int, int) const in libRaZ.a(LuaAudio.cpp.o)
decltype(auto) sol::stack::stack_detail::call<true, 0ul, void, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, sol::detail::default_construct&, Raz::AudioSystem* const&>(sol::types, void<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&>, std::__1::integer_sequence<unsigned long, 0ul>, lua_State*, int, sol::detail::default_construct&, Raz::AudioSystem* const&) in libRaZ.a(LuaAudio.cpp.o)
"Raz::SoundEffect::init()", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
int sol::call_detail::constructor_match<Raz::SoundEffect, true, true>::operator()<void (), 0ul, void>(sol::types<void ()>, std::__1::integral_constant<unsigned long, 0ul>, sol::types, sol::types<>, lua_State*, int, int) const in libRaZ.a(LuaAudio.cpp.o)
"Raz::SoundEffect::load(Raz::EchoParams const&)", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::SoundEffect::load(Raz::ChorusParams const&)", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::SoundEffect::load(Raz::DistortionParams const&)", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::SoundEffect::load(Raz::ReverberationParams const&)", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::SoundEffect::reset()", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::SoundEffect::destroy()", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
int sol::detail::usertype_alloc_destroyRaz::SoundEffect(lua_State*) in libRaZ.a(LuaAudio.cpp.o)
"Raz::SoundEffectSlot::init()", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
int sol::call_detail::constructor_match<Raz::SoundEffectSlot, true, true>::operator()<void (), 0ul, void>(sol::types<void ()>, std::__1::integral_constant<unsigned long, 0ul>, sol::types, sol::types<>, lua_State*, int, int) const in libRaZ.a(LuaAudio.cpp.o)
"Raz::SoundEffectSlot::destroy()", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
int sol::detail::usertype_alloc_destroyRaz::SoundEffectSlot(lua_State*) in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::init()", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
int sol::call_detail::constructor_match<Raz::Sound, true, true>::operator()<void (), 0ul, void>(sol::types<void ()>, std::__1::integral_constant<unsigned long, 0ul>, sol::types, sol::types<>, lua_State*, int, int) const in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::load()", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::destroy()", referenced from:
int sol::stack::call_into_lua<true, true, Raz::Sound, float, sol::member_function_wrapper<Raz::Sound (Raz::Microphone::)(float) const, Raz::Sound, Raz::Microphone, float>::caller, Raz::Sound (Raz::Microphone::&)(float) const, Raz::Microphone&>(sol::typesRaz::Sound, sol::types, lua_State*, int, sol::member_function_wrapper<Raz::Sound (Raz::Microphone::)(float) const, Raz::Sound, Raz::Microphone, float>::caller&&, Raz::Sound (Raz::Microphone::&)(float) const, Raz::Microphone&) in libRaZ.a(LuaAudio.cpp.o)
Raz::Sound::~Sound() in libRaZ.a(LuaAudio.cpp.o)
int sol::detail::usertype_alloc_destroyRaz::Sound(lua_State*) in libRaZ.a(LuaAudio.cpp.o)
Raz::Sound::~Sound() in libRaZ.a(LuaAudio.cpp.o)
int sol::stack::call_into_lua<true, true, Raz::Sound, Raz::Microphone&, sol::wrapper<Raz::Sound ()(Raz::Microphone&), void>::caller, Raz::Sound (&)(Raz::Microphone&)>(sol::typesRaz::Sound, sol::typesRaz::Microphone&, lua_State*, int, sol::wrapper<Raz::Sound ()(Raz::Microphone&), void>::caller&&, Raz::Sound (&)(Raz::Microphone&)) in libRaZ.a(LuaAudio.cpp.o)
Raz::Sound::~Sound() in libRaZ.a(LuaEntity.cpp.o)
Raz::Sound::~Sound() in libRaZ.a(LuaEntity.cpp.o)
...
"Raz::Listener::Listener(Raz::Vector<float, 3ul> const&, Raz::Matrix<float, 3ul, 3ul> const&)", referenced from:
decltype(auto) sol::stack::stack_detail::call<true, 0ul, 1ul, void, Raz::Vector<float, 3ul> const&, Raz::Matrix<float, 3ul, 3ul> const&, sol::detail::default_construct&, Raz::Listener* const&>(sol::types, void<Raz::Vector<float, 3ul> const&, Raz::Matrix<float, 3ul, 3ul> const&>, std::__1::integer_sequence<unsigned long, 0ul, 1ul>, lua_State*, int, sol::detail::default_construct&, Raz::Listener* const&) in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::Listener(Raz::Vector<float, 3ul> const&, Raz::Vector<float, 3ul> const&, Raz::Vector<float, 3ul> const&)", referenced from:
decltype(auto) sol::stack::stack_detail::call<true, 0ul, 1ul, 2ul, void, Raz::Vector<float, 3ul> const&, Raz::Vector<float, 3ul> const&, Raz::Vector<float, 3ul> const&, sol::detail::default_construct&, Raz::Listener* const&>(sol::types, void<Raz::Vector<float, 3ul> const&, Raz::Vector<float, 3ul> const&, Raz::Vector<float, 3ul> const&>, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul>, lua_State*, int, sol::detail::default_construct&, Raz::Listener* const&) in libRaZ.a(LuaAudio.cpp.o)
"Raz::WavFormat::load(Raz::FilePath const&)", referenced from:
Raz::LuaWrapper::registerFileFormatTypes() in libRaZ.a(LuaFileFormat.cpp.o)
"Raz::Microphone::recoverData(float) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
Raz::LuaWrapper::registerAudioTypes()::$_2::__invoke(Raz::Microphone&) in libRaZ.a(LuaAudio.cpp.o)
"Raz::Microphone::recoverSound(float) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
Raz::LuaWrapper::registerAudioTypes()::$_3::__invoke(Raz::Microphone&) in libRaZ.a(LuaAudio.cpp.o)
"Raz::Microphone::recoverCurrentDevice() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Microphone::recoverAvailableDuration() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Microphone::recoverAvailableSampleCount() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Microphone::stop() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Microphone::start() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::AudioSystem::recoverCurrentDevice() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::SoundEffectSlot::loadEffect(Raz::SoundEffect const&) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::unlinkSlot() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::recoverGain() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::setPosition(Raz::Vector<float, 3ul> const&) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::setVelocity(Raz::Vector<float, 3ul> const&) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::recoverPitch() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::recoverState() const", referenced from:
Raz::Sound::isPlaying() const in libRaZ.a(LuaAudio.cpp.o)
Raz::Sound::isPaused() const in libRaZ.a(LuaAudio.cpp.o)
Raz::Sound::isStopped() const in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::recoverPosition() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::recoverVelocity() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::recoverElapsedTime() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::play() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::stop() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::pause() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::rewind() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::setGain(float) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::linkSlot(Raz::SoundEffectSlot const&) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::setPitch(float) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Sound::setRepeat(bool) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::recoverGain() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::setPosition(Raz::Vector<float, 3ul> const&) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
int sol::call_detail::constructor_match<Raz::Listener, true, true>::operator()<void (Raz::Vector<float, 3ul> const&), 1ul, void, Raz::Vector<float, 3ul> const&>(sol::types<void (Raz::Vector<float, 3ul> const&)>, std::__1::integral_constant<unsigned long, 1ul>, sol::types, sol::types<Raz::Vector<float, 3ul> const&>, lua_State*, int, int) const in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::setVelocity(Raz::Vector<float, 3ul> const&) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::setOrientation(Raz::Matrix<float, 3ul, 3ul> const&) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::setOrientation(Raz::Vector<float, 3ul> const&) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::setOrientation(Raz::Vector<float, 3ul> const&, Raz::Vector<float, 3ul> const&) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::recoverPosition() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::recoverVelocity() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::recoverOrientation() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::recoverUpOrientation() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::recoverForwardOrientation() const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
"Raz::Listener::setGain(float) const", referenced from:
Raz::LuaWrapper::registerAudioTypes() in libRaZ.a(LuaAudio.cpp.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [examples/RaZ_FullDemo] Error 1
make[1]: *** [examples/CMakeFiles/RaZ_FullDemo.dir/all] Error 2

Undefined symbols for png neno api on mac m1

[ 65%] Linking CXX executable RaZ_BloomDemo
Undefined symbols for architecture arm64:
"_png_do_expand_palette_rgb8_neon", referenced from:
_png_do_read_transformations in libRaZ.a(pngrtran.c.o)
"_png_do_expand_palette_rgba8_neon", referenced from:
_png_do_read_transformations in libRaZ.a(pngrtran.c.o)
"_png_init_filter_functions_neon", referenced from:
_png_read_filter_row in libRaZ.a(pngrutil.c.o)
"_png_riffle_palette_neon", referenced from:
_png_do_read_transformations in libRaZ.a(pngrtran.c.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Platform: Mac M1 Pro
OS: Ventura 13.0.1

Roadmap and planned features?

Hey there @Razakhel ! ๐Ÿ–๏ธ

Is there a planned roadmap for this framework? Or are there expected timelines when newer features are going to be added?
In addition, is there expected to be features like alpha channel support soon? Or is this project considered to be "abandoned" and will no longer be updated or worked on?

And gratz in advance!

[Atmosphere] Implement an atmosphere simulation

I think there is an error in file GltfLoad.cpp

I think there is an error in file GltfLoad.cpp
Available:

347 if (mat.pbrData.baseColorTexture && images[mat.pbrData.baseColorTexture->textureIndex])
348 matProgram.setTexture(Texture2D::create(*images[mat.pbrData.baseColorTexture->textureIndex]), MaterialTexture::BaseColor);

...

Right:

add const std::vectorfastgltf::Texture& textures as parameter in void loadMaterials

347 if (mat.pbrData.baseColorTexture && textures[mat.pbrData.baseColorTexture->textureIndex].imageIndex)
{
auto imageIndex = textures[mat.pbrData.baseColorTexture->textureIndex].imageIndex.value();
matProgram.setTexture(Texture2D::create(*images[imageIndex]), MaterialTexture::BaseColor);
}

if (mat.emissiveTexture && textures[mat.emissiveTexture->textureIndex].imageIndex)
{
  auto imageIndex = textures[mat.emissiveTexture->textureIndex].imageIndex.value();
  matProgram.setTexture(Texture2D::create(*images[imageIndex]), MaterialTexture::Emissive);
}  

if (mat.occlusionTexture && textures[mat.occlusionTexture->textureIndex].imageIndex) { // Ambient occlusion

  const Image ambientOcclusionImg = extractAmbientOcclusionImage(*images[mat.occlusionTexture->textureIndex]);
  matProgram.setTexture(Texture2D::create(ambientOcclusionImg), MaterialTexture::Ambient);
}

if (mat.normalTexture && textures[mat.normalTexture->textureIndex].imageIndex)
{
  auto imageIndex = textures[mat.normalTexture->textureIndex].imageIndex.value();
  matProgram.setTexture(Texture2D::create(*images[imageIndex]), MaterialTexture::Normal);
}

if (mat.pbrData.metallicRoughnessTexture && textures[mat.pbrData.metallicRoughnessTexture->textureIndex].imageIndex) {
  const auto [metalnessImg, roughnessImg] = extractMetalnessRoughnessImages(*images[mat.pbrData.metallicRoughnessTexture->textureIndex]);
  matProgram.setTexture(Texture2D::create(metalnessImg), MaterialTexture::Metallic);
  matProgram.setTexture(Texture2D::create(roughnessImg), MaterialTexture::Roughness);
}

At least it works correctly for me.

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.