some tweaks or something
This commit is contained in:
parent
a566e07756
commit
67f0456352
3
Makefile
3
Makefile
@ -47,7 +47,8 @@ EXT_LIB_NAME += ext
|
||||
#VULKAN_SDK_PATH += /c/VulkanSDK/1.3.224.1/
|
||||
#VULKAN_SDK_PATH += /c/VulkanSDK/1.3.231.1/
|
||||
#VULKAN_SDK_PATH += /c/VulkanSDK/1.3.261.1/
|
||||
VULKAN_SDK_PATH += /c/VulkanSDK/1.3.296.0/
|
||||
#VULKAN_SDK_PATH += /c/VulkanSDK/1.3.296.0/
|
||||
VULKAN_SDK_PATH += /c/VulkanSDK/1.4.321.1/
|
||||
|
||||
GLSLC += $(VULKAN_SDK_PATH)/Bin/glslc
|
||||
SPV_OPTIMIZER += $(VULKAN_SDK_PATH)/Bin/spirv-opt
|
||||
|
@ -35,10 +35,11 @@
|
||||
"dispatch": 8,
|
||||
"cascades": 3,
|
||||
"cascadePower": 2.0,
|
||||
"granularity": 12,
|
||||
"granularity": 16,
|
||||
"voxelizeScale": 1,
|
||||
"occlusionFalloff": 2,
|
||||
"traceStartOffsetFactor": 1,
|
||||
"filtering": "LINEAR",
|
||||
"shadows": 0,
|
||||
"extents": {
|
||||
"min": [ -8, -8, -8 ],
|
||||
@ -396,7 +397,7 @@
|
||||
"visible" : true,
|
||||
"center" : false,
|
||||
"sensitivity": [ 50, 50 ],
|
||||
"smoothing": [ 0.75, 0.75 ]
|
||||
"smoothing": [ 0.25, 0.25 ]
|
||||
},
|
||||
"mode" : "windowed", // fullscreen, borderless, windowed
|
||||
"icon" : "./data/textures/icon.png",
|
||||
|
@ -26,10 +26,10 @@
|
||||
"bias": {
|
||||
"constant": 1.25,
|
||||
"slope": 1.75,
|
||||
"shader": 0.05 // 0.000005 //0.000000005
|
||||
"shader": 0.000005 // 0.000005 //0.000000005
|
||||
},
|
||||
"radius": [0.5, 0],
|
||||
"resolution": 768,
|
||||
"resolution": 1024,
|
||||
"shadows": true,
|
||||
"dynamic": true
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
],
|
||||
"metadata": {
|
||||
"light": {
|
||||
"fog": {
|
||||
"fog-0": {
|
||||
// "color": [ 0.1, 0.1, 0.1 ],
|
||||
// "color": [ 0.2, 0.2, 0.2 ],
|
||||
"color": [ 0.3, 0.3, 0.3 ],
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"import": "./base_sourceengine.json",
|
||||
"assets": [
|
||||
// { "filename": "./models/ss2_medsci1_smallish.glb" }
|
||||
{ "filename": "./models/ss2_medsci1_smallish/graph.json" }
|
||||
// { "filename": "./models/ss2_medsci1.glb" }
|
||||
{ "filename": "./models/ss2_medsci1/graph.json" }
|
||||
],
|
||||
"metadata": {
|
||||
"graph": {
|
||||
|
@ -271,9 +271,23 @@ void populateSurface() {
|
||||
|
||||
surface.motion = cNDC.xy - pNDC.xy;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void directLighting() {
|
||||
#if VXGI
|
||||
// to-do: proper "visual" of the VXGI maps (directly pick the pixel instead of just rawdog tracing for it)
|
||||
if ( ubo.settings.mode.type == 0x000A ) {
|
||||
Ray ray;
|
||||
ray.direction = surface.ray.direction;
|
||||
ray.origin = surface.ray.origin;
|
||||
vec4 radiance = voxelConeTrace( ray, 0.0000001f );
|
||||
|
||||
surface.material.albedo.rgb = radiance.rgb;
|
||||
surface.material.indirect.rgb = vec3(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
surface.light.rgb += surface.material.albedo.rgb * ubo.settings.lighting.ambient.rgb * surface.material.occlusion; // add ambient lighting
|
||||
surface.light.rgb += surface.material.indirect.rgb; // add indirect lighting
|
||||
#if PBR
|
||||
|
@ -45,6 +45,10 @@ void ext::VoxelizerSceneBehavior::initialize( uf::Object& self ) {
|
||||
auto& normal = sceneTextures.voxels.normal.emplace_back();
|
||||
normal.fromBuffers( NULL, 0, uf::renderer::enums::Format::R16G16_SFLOAT, metadata.voxelSize.x, metadata.voxelSize.y, metadata.voxelSize.z, 1, VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT, VK_IMAGE_LAYOUT_GENERAL );
|
||||
auto& radiance = sceneTextures.voxels.radiance.emplace_back();
|
||||
if ( metadata.filtering == "NEAREST" ) {
|
||||
radiance.sampler.descriptor.filter.min = uf::renderer::enums::Filter::NEAREST;
|
||||
radiance.sampler.descriptor.filter.mag = uf::renderer::enums::Filter::NEAREST;
|
||||
}
|
||||
radiance.fromBuffers( NULL, 0, uf::renderer::settings::pipelines::hdr ? uf::renderer::enums::Format::HDR : uf::renderer::enums::Format::SDR, metadata.voxelSize.x, metadata.voxelSize.y, metadata.voxelSize.z, 1, VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT, VK_IMAGE_LAYOUT_GENERAL );
|
||||
// auto& depth = sceneTextures.voxels.depth.emplace_back();
|
||||
// depth.fromBuffers( (void*) empty.data(), empty.size(), uf::renderer::enums::Format::R16_SFLOAT, metadata.voxelSize.x, metadata.voxelSize.y, metadata.voxelSize.z, 1, VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT, VK_IMAGE_LAYOUT_GENERAL );
|
||||
@ -275,6 +279,7 @@ void ext::VoxelizerSceneBehavior::Metadata::serialize( uf::Object& self, uf::Ser
|
||||
serializer["vxgi"]["occlusionFalloff"] = /*this->*/occlusionFalloff;
|
||||
serializer["vxgi"]["traceStartOffsetFactor"] = /*this->*/traceStartOffsetFactor;
|
||||
serializer["vxgi"]["shadows"] = /*this->*/shadows;
|
||||
serializer["vxgi"]["filtering"] = /*this->*/filtering;
|
||||
|
||||
serializer["vxgi"]["extents"]["min"] = uf::vector::encode(/*this->*/extents.min);
|
||||
serializer["vxgi"]["extents"]["max"] = uf::vector::encode(/*this->*/extents.max);
|
||||
@ -306,6 +311,7 @@ void ext::VoxelizerSceneBehavior::Metadata::deserialize( uf::Object& self, uf::S
|
||||
/*this->*/occlusionFalloff = serializer["vxgi"]["occlusionFalloff"].as(/*this->*/occlusionFalloff);
|
||||
/*this->*/traceStartOffsetFactor = serializer["vxgi"]["traceStartOffsetFactor"].as(/*this->*/traceStartOffsetFactor);
|
||||
/*this->*/shadows = serializer["vxgi"]["shadows"].as(/*this->*/shadows);
|
||||
/*this->*/filtering = serializer["vxgi"]["filtering"].as(/*this->*/filtering);
|
||||
|
||||
/*this->*/extents.min = uf::vector::decode( serializer["vxgi"]["extents"]["min"], /*this->*/extents.min );
|
||||
/*this->*/extents.max = uf::vector::decode( serializer["vxgi"]["extents"]["max"], /*this->*/extents.max );
|
||||
|
@ -25,6 +25,7 @@ namespace ext {
|
||||
float occlusionFalloff = 0;
|
||||
float traceStartOffsetFactor = 1.0f;
|
||||
uint32_t shadows = 0;
|
||||
uf::stl::string filtering = "LINEAR";
|
||||
|
||||
struct {
|
||||
pod::Vector3f min = {};
|
||||
|
Loading…
Reference in New Issue
Block a user