add missing method handlers on Windows and use 32bit depth buffer for render target by default
This commit is contained in:
@@ -76,7 +76,6 @@ namespace polyvox {
|
|||||||
NameComponentManager* _ncm = nullptr;
|
NameComponentManager* _ncm = nullptr;
|
||||||
Engine* _engine;
|
Engine* _engine;
|
||||||
Scene* _scene;
|
Scene* _scene;
|
||||||
MaterialProvider* _unlitProvider = nullptr;
|
|
||||||
MaterialProvider* _ubershaderProvider = nullptr;
|
MaterialProvider* _ubershaderProvider = nullptr;
|
||||||
gltfio::ResourceLoader* _gltfResourceLoader = nullptr;
|
gltfio::ResourceLoader* _gltfResourceLoader = nullptr;
|
||||||
gltfio::TextureProvider* _stbDecoder = nullptr;
|
gltfio::TextureProvider* _stbDecoder = nullptr;
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ namespace polyvox {
|
|||||||
|
|
||||||
bool setCamera(EntityId asset, const char* nodeName);
|
bool setCamera(EntityId asset, const char* nodeName);
|
||||||
|
|
||||||
|
|
||||||
void createSwapChain(const void* surface, uint32_t width, uint32_t height);
|
void createSwapChain(const void* surface, uint32_t width, uint32_t height);
|
||||||
void destroySwapChain();
|
void destroySwapChain();
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@ namespace polyvox {
|
|||||||
void clearBackgroundImage();
|
void clearBackgroundImage();
|
||||||
void setBackgroundImagePosition(float x, float y, bool clamp);
|
void setBackgroundImagePosition(float x, float y, bool clamp);
|
||||||
void moveCameraToAsset(EntityId entityId);
|
void moveCameraToAsset(EntityId entityId);
|
||||||
|
void setViewFrustumCulling(bool enabled);
|
||||||
void setCameraExposure(float aperture, float shutterSpeed, float sensitivity);
|
void setCameraExposure(float aperture, float shutterSpeed, float sensitivity);
|
||||||
void setCameraPosition(float x, float y, float z);
|
void setCameraPosition(float x, float y, float z);
|
||||||
void setCameraRotation(float rads, float x, float y, float z);
|
void setCameraRotation(float rads, float x, float y, float z);
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ void set_position(void* assetManager, EntityId asset, float x, float y, float z)
|
|||||||
void set_rotation(void* assetManager, EntityId asset, float rads, float x, float y, float z);
|
void set_rotation(void* assetManager, EntityId asset, float rads, float x, float y, float z);
|
||||||
void set_scale(void* assetManager, EntityId asset, float scale);
|
void set_scale(void* assetManager, EntityId asset, float scale);
|
||||||
void move_camera_to_asset(const void* const viewer, EntityId asset);
|
void move_camera_to_asset(const void* const viewer, EntityId asset);
|
||||||
|
void set_view_frustum_culling(const void* const viewer, bool enabled);
|
||||||
void set_camera_exposure(const void* const viewer, float aperture, float shutterSpeed, float sensitivity);
|
void set_camera_exposure(const void* const viewer, float aperture, float shutterSpeed, float sensitivity);
|
||||||
void set_camera_position(const void* const viewer, float x, float y, float z);
|
void set_camera_position(const void* const viewer, float x, float y, float z);
|
||||||
void set_camera_rotation(const void* const viewer, float rads, float x, float y, float z);
|
void set_camera_rotation(const void* const viewer, float rads, float x, float y, float z);
|
||||||
|
|||||||
@@ -21,9 +21,8 @@
|
|||||||
#include "Log.hpp"
|
#include "Log.hpp"
|
||||||
#include "AssetManager.hpp"
|
#include "AssetManager.hpp"
|
||||||
|
|
||||||
#include "material/UnlitMaterialProvider.hpp"
|
|
||||||
#include "material/FileMaterialProvider.hpp"
|
#include "material/FileMaterialProvider.hpp"
|
||||||
// #include "gltfio/materials/uberarchive.h"
|
#include "gltfio/materials/uberarchive.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "material/image.h"
|
#include "material/image.h"
|
||||||
@@ -53,14 +52,14 @@ _scene(scene) {
|
|||||||
_gltfResourceLoader = new ResourceLoader({.engine = _engine,
|
_gltfResourceLoader = new ResourceLoader({.engine = _engine,
|
||||||
.normalizeSkinningWeights = true });
|
.normalizeSkinningWeights = true });
|
||||||
|
|
||||||
auto uberdata = resourceLoaderWrapper->load("packages/polyvox_filament/assets/default.uberz");
|
// auto uberdata = resourceLoaderWrapper->load("packages/polyvox_filament/assets/default.uberz");
|
||||||
|
|
||||||
if (!uberdata.data) {
|
// if (!uberdata.data) {
|
||||||
Log("Failed to load ubershader material. This is fatal.");
|
// Log("Failed to load ubershader material. This is fatal.");
|
||||||
}
|
// }
|
||||||
|
|
||||||
_ubershaderProvider = gltfio::createUbershaderProvider(
|
_ubershaderProvider = gltfio::createUbershaderProvider(
|
||||||
_engine, uberdata.data, uberdata.size);
|
_engine, UBERARCHIVE_DEFAULT_DATA, UBERARCHIVE_DEFAULT_SIZE);
|
||||||
Log("Created ubershader provider.");
|
Log("Created ubershader provider.");
|
||||||
|
|
||||||
EntityManager &em = EntityManager::get();
|
EntityManager &em = EntityManager::get();
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ void FilamentViewer::createRenderTarget(intptr_t textureId, uint32_t width, uint
|
|||||||
.height(height)
|
.height(height)
|
||||||
.levels(1)
|
.levels(1)
|
||||||
.usage(filament::Texture::Usage::DEPTH_ATTACHMENT)
|
.usage(filament::Texture::Usage::DEPTH_ATTACHMENT)
|
||||||
.format(filament::Texture::InternalFormat::DEPTH24)
|
.format(filament::Texture::InternalFormat::DEPTH32F)
|
||||||
.build(*_engine);
|
.build(*_engine);
|
||||||
_rt = filament::RenderTarget::Builder()
|
_rt = filament::RenderTarget::Builder()
|
||||||
.texture(RenderTarget::AttachmentPoint::COLOR, _rtColor)
|
.texture(RenderTarget::AttachmentPoint::COLOR, _rtColor)
|
||||||
@@ -901,6 +901,10 @@ void FilamentViewer::updateViewportAndCameraProjection(
|
|||||||
contentScaleFactor);
|
contentScaleFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FilamentViewer::setViewFrustumCulling(bool enabled) {
|
||||||
|
_view->setFrustumCullingEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
void FilamentViewer::setCameraPosition(float x, float y, float z) {
|
void FilamentViewer::setCameraPosition(float x, float y, float z) {
|
||||||
Camera& cam =_view->getCamera();
|
Camera& cam =_view->getCamera();
|
||||||
|
|
||||||
|
|||||||
@@ -96,10 +96,14 @@ extern "C" {
|
|||||||
return ((FilamentViewer*)viewer)->setCamera(asset, nodeName);
|
return ((FilamentViewer*)viewer)->setCamera(asset, nodeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void void move_camera_to_asset(const void* const viewer, EntityId asset) {
|
void move_camera_to_asset(const void* const viewer, EntityId asset) {
|
||||||
((FilamentViewer*)viewer)->moveCameraToAsset(asset);
|
((FilamentViewer*)viewer)->moveCameraToAsset(asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_view_frustum_culling(const void* const viewer, bool enabled) {
|
||||||
|
((FilamentViewer*)viewer)->setViewFrustumCulling(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
void set_camera_focus_distance(const void* const viewer, float distance) {
|
void set_camera_focus_distance(const void* const viewer, float distance) {
|
||||||
((FilamentViewer*)viewer)->setCameraFocusDistance(distance);
|
((FilamentViewer*)viewer)->setCameraFocusDistance(distance);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,14 +18,11 @@
|
|||||||
#include "SceneAsset.hpp"
|
#include "SceneAsset.hpp"
|
||||||
#include "Log.hpp"
|
#include "Log.hpp"
|
||||||
|
|
||||||
#include "material/StandardMaterialProvider.hpp"
|
|
||||||
#include "material/UnlitMaterialProvider.hpp"
|
|
||||||
#include "material/FileMaterialProvider.hpp"
|
#include "material/FileMaterialProvider.hpp"
|
||||||
#include "gltfio/materials/uberarchive.h"
|
#include "gltfio/materials/uberarchive.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "material/image.h"
|
#include "material/image.h"
|
||||||
#include "material/unlit_opaque.h"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace polyvox {
|
namespace polyvox {
|
||||||
|
|||||||
Reference in New Issue
Block a user