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;
|
||||
Engine* _engine;
|
||||
Scene* _scene;
|
||||
MaterialProvider* _unlitProvider = nullptr;
|
||||
MaterialProvider* _ubershaderProvider = nullptr;
|
||||
gltfio::ResourceLoader* _gltfResourceLoader = nullptr;
|
||||
gltfio::TextureProvider* _stbDecoder = nullptr;
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace polyvox {
|
||||
|
||||
bool setCamera(EntityId asset, const char* nodeName);
|
||||
|
||||
|
||||
void createSwapChain(const void* surface, uint32_t width, uint32_t height);
|
||||
void destroySwapChain();
|
||||
|
||||
@@ -87,7 +88,7 @@ namespace polyvox {
|
||||
void clearBackgroundImage();
|
||||
void setBackgroundImagePosition(float x, float y, bool clamp);
|
||||
void moveCameraToAsset(EntityId entityId);
|
||||
|
||||
void setViewFrustumCulling(bool enabled);
|
||||
void setCameraExposure(float aperture, float shutterSpeed, float sensitivity);
|
||||
void setCameraPosition(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_scale(void* assetManager, EntityId asset, float scale);
|
||||
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_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);
|
||||
|
||||
@@ -21,9 +21,8 @@
|
||||
#include "Log.hpp"
|
||||
#include "AssetManager.hpp"
|
||||
|
||||
#include "material/UnlitMaterialProvider.hpp"
|
||||
#include "material/FileMaterialProvider.hpp"
|
||||
// #include "gltfio/materials/uberarchive.h"
|
||||
#include "gltfio/materials/uberarchive.h"
|
||||
|
||||
extern "C" {
|
||||
#include "material/image.h"
|
||||
@@ -53,14 +52,14 @@ _scene(scene) {
|
||||
_gltfResourceLoader = new ResourceLoader({.engine = _engine,
|
||||
.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) {
|
||||
Log("Failed to load ubershader material. This is fatal.");
|
||||
}
|
||||
// if (!uberdata.data) {
|
||||
// Log("Failed to load ubershader material. This is fatal.");
|
||||
// }
|
||||
|
||||
_ubershaderProvider = gltfio::createUbershaderProvider(
|
||||
_engine, uberdata.data, uberdata.size);
|
||||
_engine, UBERARCHIVE_DEFAULT_DATA, UBERARCHIVE_DEFAULT_SIZE);
|
||||
Log("Created ubershader provider.");
|
||||
|
||||
EntityManager &em = EntityManager::get();
|
||||
|
||||
@@ -602,7 +602,7 @@ void FilamentViewer::createRenderTarget(intptr_t textureId, uint32_t width, uint
|
||||
.height(height)
|
||||
.levels(1)
|
||||
.usage(filament::Texture::Usage::DEPTH_ATTACHMENT)
|
||||
.format(filament::Texture::InternalFormat::DEPTH24)
|
||||
.format(filament::Texture::InternalFormat::DEPTH32F)
|
||||
.build(*_engine);
|
||||
_rt = filament::RenderTarget::Builder()
|
||||
.texture(RenderTarget::AttachmentPoint::COLOR, _rtColor)
|
||||
@@ -901,6 +901,10 @@ void FilamentViewer::updateViewportAndCameraProjection(
|
||||
contentScaleFactor);
|
||||
}
|
||||
|
||||
void FilamentViewer::setViewFrustumCulling(bool enabled) {
|
||||
_view->setFrustumCullingEnabled(enabled);
|
||||
}
|
||||
|
||||
void FilamentViewer::setCameraPosition(float x, float y, float z) {
|
||||
Camera& cam =_view->getCamera();
|
||||
|
||||
|
||||
@@ -96,10 +96,14 @@ extern "C" {
|
||||
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);
|
||||
}
|
||||
|
||||
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) {
|
||||
((FilamentViewer*)viewer)->setCameraFocusDistance(distance);
|
||||
}
|
||||
|
||||
@@ -18,14 +18,11 @@
|
||||
#include "SceneAsset.hpp"
|
||||
#include "Log.hpp"
|
||||
|
||||
#include "material/StandardMaterialProvider.hpp"
|
||||
#include "material/UnlitMaterialProvider.hpp"
|
||||
#include "material/FileMaterialProvider.hpp"
|
||||
#include "gltfio/materials/uberarchive.h"
|
||||
|
||||
extern "C" {
|
||||
#include "material/image.h"
|
||||
#include "material/unlit_opaque.h"
|
||||
}
|
||||
|
||||
namespace polyvox {
|
||||
|
||||
Reference in New Issue
Block a user