Commit for 2022.07.09 22-04-13.7z
This commit is contained in:
parent
26a933307b
commit
cbd76acbd5
17
Makefile
17
Makefile
@ -343,6 +343,8 @@ clean:
|
||||
@-rm -f $(OBJS_EXT_DLL)
|
||||
@-rm -f $(OBJS)
|
||||
|
||||
@-rm $(shell find $(ENGINE_SRC_DIR) -name "*.$(PREFIX).o") $(shell find $(EXT_SRC_DIR) -name "*.$(PREFIX).o") $(shell find $(DEP_SRC_DIR) -name "*.$(PREFIX).o")
|
||||
|
||||
ifneq (,$(findstring dreamcast,$(ARCH)))
|
||||
@-rm ./bin/dreamcast/build/*
|
||||
@-rm ./bin/dreamcast/romdisk.*
|
||||
@ -381,11 +383,12 @@ clean-shaders:
|
||||
-rm $(TARGET_SHADERS)
|
||||
|
||||
backup:
|
||||
make ARCH=dreamcast clean
|
||||
make CC=gcc RENDERER=opengl clean
|
||||
make CC=gcc RENDERER=vulkan clean
|
||||
make CC=clang RENDERER=opengl clean
|
||||
make CC=clang RENDERER=vulkan clean
|
||||
make CC=zig RENDERER=opengl clean
|
||||
make CC=zig RENDERER=vulkan clean
|
||||
#make ARCH=dreamcast clean
|
||||
#make CC=gcc RENDERER=opengl clean
|
||||
#make CC=gcc RENDERER=vulkan clean
|
||||
#make CC=clang RENDERER=opengl clean
|
||||
#make CC=clang RENDERER=vulkan clean
|
||||
#make CC=zig RENDERER=opengl clean
|
||||
#make CC=zig RENDERER=vulkan clean
|
||||
@-rm $(shell find $(ENGINE_SRC_DIR) -name "*.o") $(shell find $(EXT_SRC_DIR) -name "*.o") $(shell find $(DEP_SRC_DIR) -name "*.o")
|
||||
$(7Z) a -r ../misc/backups/$(shell date +"%Y.%m.%d\ %H-%M-%S").7z .
|
@ -1,11 +1,11 @@
|
||||
{
|
||||
"engine": {
|
||||
"scenes": {
|
||||
"start": "McDonalds",
|
||||
"start": "SH2_McDonalds",
|
||||
"meshes": { "interleaved": false },
|
||||
"matrix": { "reverseInfinite": true },
|
||||
"lights": { "enabled": true,
|
||||
"useLightmaps": true,
|
||||
"useLightmaps": false,
|
||||
"max": 32
|
||||
},
|
||||
"shadows": {
|
||||
|
@ -15,6 +15,7 @@
|
||||
"print": {
|
||||
"tree": false,
|
||||
"stats": false,
|
||||
"lights": false,
|
||||
"meshes": false,
|
||||
"materials": false,
|
||||
"textures": false
|
||||
@ -33,7 +34,6 @@
|
||||
"combined": false,
|
||||
"encode buffers": true,
|
||||
"unwrap": true, // "tagged",
|
||||
// "unwrap": "tagged",
|
||||
"quit": true
|
||||
},
|
||||
"baking": {
|
||||
|
@ -14,10 +14,16 @@
|
||||
"model": {
|
||||
"baking": {
|
||||
"enabled": false,
|
||||
"resolution": 1024
|
||||
"resolution": 2048,
|
||||
"settings": {
|
||||
"useInputMeshUvs": false
|
||||
}
|
||||
},
|
||||
"renderer": {
|
||||
"front face": "cw",
|
||||
"cull mode": "back",
|
||||
"filter": "linear"
|
||||
},
|
||||
"filter": "LINEAR",
|
||||
"lightmap": false,
|
||||
"tags": {
|
||||
"/^Mesh_/": {
|
||||
"physics": { "type": "mesh", "static": true },
|
||||
|
@ -1,7 +1,8 @@
|
||||
{
|
||||
"import": "/scene.json",
|
||||
"assets": [
|
||||
"./loading.json"
|
||||
// "./loading.json"
|
||||
"./cornell.json"
|
||||
],
|
||||
"system": {
|
||||
"hot reload": {
|
||||
@ -28,6 +29,13 @@
|
||||
"sigma": 0.8,
|
||||
"samples": 5
|
||||
},
|
||||
"rt": {
|
||||
"defaultRayBounds": [ 0.001, 1024.0 ],
|
||||
"alphaTestOffset": 0.001,
|
||||
"samples": 1,
|
||||
"paths": 4,
|
||||
"frameAccumulationMinimum": 0
|
||||
},
|
||||
"light": {
|
||||
"exposure": 1.0,
|
||||
"gamma": 1.0,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"import": "/light.json",
|
||||
"ignore": true,
|
||||
"ignore": false,
|
||||
"assets": [
|
||||
],
|
||||
"transform": {
|
||||
|
@ -4,7 +4,16 @@
|
||||
// { "filename": "./static.json", "delay": 8 },
|
||||
|
||||
// { "filename": "./models/sh_mcd.glb" }
|
||||
{ "filename": "./models/sh_mcd/graph.json" }
|
||||
// { "filename": "./models/sh_mcd/graph.json" }
|
||||
|
||||
// { "filename": "./models/mcdonalds.glb" }
|
||||
{ "filename": "./models/mcdonalds/graph.json" }
|
||||
|
||||
// { "filename": "./models/mini_mcd.glb" }
|
||||
// { "filename": "./models/mini_mcd/graph.json" }
|
||||
|
||||
// { "filename": "/cornell/cornell.glb" }
|
||||
// { "filename": "/cornell/cornell/graph.json" }
|
||||
],
|
||||
"metadata": {
|
||||
"model": {
|
||||
@ -18,7 +27,8 @@
|
||||
"renderer": {
|
||||
"front face": "cw",
|
||||
"cull mode": "back",
|
||||
"filter": "linear"
|
||||
"filter": "linear",
|
||||
"alpha mode": "blend"
|
||||
},
|
||||
"tags": {
|
||||
"/^worldspawn/": {
|
||||
@ -107,7 +117,8 @@
|
||||
"prop_physics_override_5822": { "action": "load", "payload": { "import": "./prop.json" } },
|
||||
"prop_physics_override_5824": { "action": "load", "payload": { "import": "./prop.json" } },
|
||||
|
||||
"tools/toolsnodraw": { "material": { "base": [0, 0, 0, 0] } }
|
||||
"tools/toolsnodraw": { "material": { "base": [0, 0, 0, 0] } },
|
||||
"materials/models/props_wasteland/prison_lamp001a": { "material": { "emissive": [0, 0, 0, 0] } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,8 +37,8 @@
|
||||
// "ambient": [ 0, 0, 0 ],
|
||||
// "ambient": [ 0.025, 0.025, 0.025 ],
|
||||
// "ambient": [ 0.075, 0.075, 0.075 ],
|
||||
// "ambient": [ 0.1, 0.1, 0.1 ],
|
||||
"ambient": [ 0.4, 0.4, 0.4 ],
|
||||
"ambient": [ 0.1, 0.1, 0.1 ],
|
||||
// "ambient": [ 0.4, 0.4, 0.4 ],
|
||||
// "ambient": [ 0.8, 0.8, 0.8 ],
|
||||
|
||||
"fog-": {
|
||||
|
@ -28,7 +28,9 @@
|
||||
"info_player_spawn": { "action": "attach", "filename": "./player.json" },
|
||||
|
||||
"Material.071_574B138E_c.bmp": { "material": { "modeAlpha": "BLEND" } },
|
||||
"Material.070_41A41EE3_c.bmp": { "material": { "modeAlpha": "BLEND" } }
|
||||
"Material.070_41A41EE3_c.bmp": { "material": { "modeAlpha": "BLEND" } },
|
||||
|
||||
"light_sun": { "light": { "power": 25000 } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,14 +15,14 @@ float gaSchlickGGX(float cosLi, float cosLo, float roughness) {
|
||||
vec3 fresnelSchlick(vec3 F0, float cosTheta) { return F0 + (1.0 - F0) * pow(1.0 - cosTheta, 5.0); }
|
||||
#if (!BAKING && !COMPUTE) || RAYTRACE
|
||||
void pbr() {
|
||||
if ( surface.material.lightmapped && validTextureIndex( surface.instance.lightmapID ) ) return;
|
||||
if ( surface.material.lightmapped ) return;
|
||||
|
||||
const float Rs = 4.0; // specular lighting looks gross without this
|
||||
const vec3 F0 = mix(vec3(0.04), surface.material.albedo.rgb, surface.material.metallic);
|
||||
const vec3 Lo = normalize( -surface.position.eye );
|
||||
const float cosLo = max(0.0, dot(surface.normal.eye, Lo));
|
||||
|
||||
for ( uint i = 0; i < ubo.lights; ++i ) {
|
||||
for ( uint i = 0; i < ubo.settings.lengths.lights; ++i ) {
|
||||
const Light light = lights[i];
|
||||
if ( light.power <= LIGHT_POWER_CUTOFF ) continue;
|
||||
const vec3 Liu = vec3(ubo.eyes[surface.pass].view * vec4(light.position, 1)) - surface.position.eye;
|
||||
|
@ -18,7 +18,7 @@ const vec2 poissonDisk[16] = vec2[](
|
||||
);
|
||||
|
||||
#ifndef SHADOW_SAMPLES
|
||||
#define SHADOW_SAMPLES ubo.shadowSamples
|
||||
#define SHADOW_SAMPLES ubo.settings.lighting.shadowSamples
|
||||
#endif
|
||||
#if VXGI
|
||||
float voxelShadowFactor( const Light, float def );
|
||||
|
@ -175,6 +175,8 @@ struct SurfaceMaterial {
|
||||
|
||||
struct Surface {
|
||||
uint pass;
|
||||
uint subID;
|
||||
|
||||
vec3 uv;
|
||||
vec3 st;
|
||||
Space position;
|
||||
@ -200,6 +202,27 @@ struct MSAA {
|
||||
} msaa;
|
||||
#endif
|
||||
// UBO settings
|
||||
struct SettingsLengths {
|
||||
uint lights;
|
||||
uint materials;
|
||||
uint textures;
|
||||
uint drawCommands;
|
||||
};
|
||||
struct SettingsMode {
|
||||
vec4 parameters;
|
||||
uint type;
|
||||
uint scalar;
|
||||
uint msaa;
|
||||
uint frameNumber;
|
||||
};
|
||||
struct SettingsLighting {
|
||||
vec3 ambient;
|
||||
float padding1;
|
||||
|
||||
uint indexSkybox;
|
||||
uint shadowSamples;
|
||||
uint useLightmaps;
|
||||
};
|
||||
struct SettingsFog {
|
||||
vec3 color;
|
||||
float stepScale;
|
||||
@ -216,25 +239,12 @@ struct SettingsFog {
|
||||
float padding2;
|
||||
float padding3;
|
||||
};
|
||||
|
||||
struct SettingsMode {
|
||||
uint type;
|
||||
uint scalar;
|
||||
vec2 padding;
|
||||
vec4 parameters;
|
||||
struct SettingsBloom {
|
||||
float exposure;
|
||||
float brightnessThreshold;
|
||||
float gamma;
|
||||
uint padding;
|
||||
};
|
||||
|
||||
struct SettingsRayTrace {
|
||||
vec2 defaultRayBounds;
|
||||
float alphaTestOffset;
|
||||
float padding1;
|
||||
|
||||
uint samples;
|
||||
uint paths;
|
||||
uint frameAccumulationMinimum;
|
||||
uint padding2;
|
||||
};
|
||||
// VXGI stuff
|
||||
struct SettingsVxgi {
|
||||
mat4 matrix;
|
||||
|
||||
@ -248,10 +258,23 @@ struct SettingsVxgi {
|
||||
uint padding2;
|
||||
uint padding3;
|
||||
};
|
||||
struct SettingsRayTrace {
|
||||
vec2 defaultRayBounds;
|
||||
float alphaTestOffset;
|
||||
float padding1;
|
||||
|
||||
uint samples;
|
||||
uint paths;
|
||||
uint frameAccumulationMinimum;
|
||||
uint padding2;
|
||||
};
|
||||
|
||||
struct Settings {
|
||||
SettingsLengths lengths;
|
||||
SettingsMode mode;
|
||||
SettingsLighting lighting;
|
||||
SettingsFog fog;
|
||||
SettingsBloom bloom;
|
||||
SettingsVxgi vxgi;
|
||||
SettingsRayTrace rt;
|
||||
};
|
||||
|
@ -49,24 +49,6 @@ layout (binding = 5) uniform UBO {
|
||||
EyeMatrices eyes[2];
|
||||
|
||||
Settings settings;
|
||||
|
||||
uint lights;
|
||||
uint materials;
|
||||
uint textures;
|
||||
uint drawCommands;
|
||||
|
||||
vec3 ambient;
|
||||
float gamma;
|
||||
|
||||
float exposure;
|
||||
float brightnessThreshold;
|
||||
uint msaa;
|
||||
uint shadowSamples;
|
||||
|
||||
int indexSkybox;
|
||||
uint useLightmaps;
|
||||
uint frameNumber;
|
||||
uint padding3;
|
||||
} ubo;
|
||||
/*
|
||||
*/
|
||||
@ -129,16 +111,16 @@ layout(buffer_reference, scalar) buffer VID { uint v[]; };
|
||||
|
||||
void postProcess() {
|
||||
float brightness = dot(surface.fragment.rgb, vec3(0.2126, 0.7152, 0.0722));
|
||||
outFragBright = brightness > ubo.brightnessThreshold ? vec4(surface.fragment.rgb, 1.0) : vec4(0, 0, 0, 1);
|
||||
outFragBright = brightness > ubo.settings.bloom.brightnessThreshold ? vec4(surface.fragment.rgb, 1.0) : vec4(0, 0, 0, 1);
|
||||
|
||||
#if FOG
|
||||
fog( surface.ray, surface.fragment.rgb, surface.fragment.a );
|
||||
#endif
|
||||
#if TONE_MAP
|
||||
surface.fragment.rgb = vec3(1.0) - exp(-surface.fragment.rgb * ubo.exposure);
|
||||
surface.fragment.rgb = vec3(1.0) - exp(-surface.fragment.rgb * ubo.settings.bloom.exposure);
|
||||
#endif
|
||||
#if GAMMA_CORRECT
|
||||
surface.fragment.rgb = pow(surface.fragment.rgb, vec3(1.0 / ubo.gamma));
|
||||
surface.fragment.rgb = pow(surface.fragment.rgb, vec3(1.0 / ubo.settings.bloom.gamma));
|
||||
#endif
|
||||
#if WHITENOISE
|
||||
if ( enabled(ubo.settings.mode.type, 1) ) whitenoise(surface.fragment.rgb, ubo.settings.mode.parameters);
|
||||
@ -155,7 +137,7 @@ void populateSurface() {
|
||||
#if !MULTISAMPLING
|
||||
const float depth = subpassLoad(samplerDepth).r;
|
||||
#else
|
||||
const float depth = subpassLoad(samplerDepth, msaa.currentID).r; // resolve(samplerDepth, ubo.msaa).r;
|
||||
const float depth = subpassLoad(samplerDepth, msaa.currentID).r; // resolve(samplerDepth, ubo.settings.mode.msaa).r;
|
||||
#endif
|
||||
|
||||
vec4 positionEye = ubo.eyes[surface.pass].iProjection * vec4(inUv * 2.0 - 1.0, depth, 1.0);
|
||||
@ -200,16 +182,16 @@ void populateSurface() {
|
||||
surface.normal.world = decodeNormals( subpassLoad(samplerNormal).xy );
|
||||
const uvec2 ID = subpassLoad(samplerId).xy;
|
||||
#else
|
||||
surface.normal.world = decodeNormals( subpassLoad(samplerNormal, msaa.currentID).xy ); // decodeNormals( resolve(samplerNormal, ubo.msaa).xy );
|
||||
const uvec2 ID = msaa.IDs[msaa.currentID]; // subpassLoad(samplerId, msaa.currentID).xy; //resolve(samplerId, ubo.msaa).xy;
|
||||
surface.normal.world = decodeNormals( subpassLoad(samplerNormal, msaa.currentID).xy ); // decodeNormals( resolve(samplerNormal, ubo.settings.mode.msaa).xy );
|
||||
const uvec2 ID = msaa.IDs[msaa.currentID]; // subpassLoad(samplerId, msaa.currentID).xy; //resolve(samplerId, ubo.settings.mode.msaa).xy;
|
||||
#endif
|
||||
surface.normal.eye = vec3( ubo.eyes[surface.pass].view * vec4(surface.normal.world, 0.0) );
|
||||
|
||||
const uint drawID = ID.x - 1;
|
||||
const uint instanceID = ID.y - 1;
|
||||
if ( ID.x == 0 || ID.y == 0 ) {
|
||||
if ( 0 <= ubo.indexSkybox && ubo.indexSkybox < CUBEMAPS ) {
|
||||
surface.fragment.rgb = texture( samplerCubemaps[ubo.indexSkybox], surface.ray.direction ).rgb;
|
||||
if ( 0 <= ubo.settings.lighting.indexSkybox && ubo.settings.lighting.indexSkybox < CUBEMAPS ) {
|
||||
surface.fragment.rgb = texture( samplerCubemaps[ubo.settings.lighting.indexSkybox], surface.ray.direction ).rgb;
|
||||
}
|
||||
surface.fragment.a = 0.0;
|
||||
postProcess();
|
||||
@ -232,8 +214,8 @@ void populateSurface() {
|
||||
const vec4 uv = subpassLoad(samplerUv);
|
||||
const vec2 mips = subpassLoad(samplerMips).xy;
|
||||
#else
|
||||
const vec4 uv = subpassLoad(samplerUv, msaa.currentID); // resolve(samplerUv, ubo.msaa);
|
||||
const vec2 mips = subpassLoad(samplerMips, msaa.currentID).xy; // resolve(samplerUv, ubo.msaa);
|
||||
const vec4 uv = subpassLoad(samplerUv, msaa.currentID); // resolve(samplerUv, ubo.settings.mode.msaa);
|
||||
const vec2 mips = subpassLoad(samplerMips, msaa.currentID).xy; // resolve(samplerUv, ubo.settings.mode.msaa);
|
||||
#endif
|
||||
surface.uv.xy = uv.xy;
|
||||
surface.uv.z = mips.x;
|
||||
@ -255,7 +237,7 @@ void populateSurface() {
|
||||
|
||||
}
|
||||
// Lightmap
|
||||
if ( bool(ubo.useLightmaps) && validTextureIndex( surface.instance.lightmapID ) ) {
|
||||
if ( bool(ubo.settings.lighting.useLightmaps) && validTextureIndex( surface.instance.lightmapID ) ) {
|
||||
vec4 light = sampleTexture( surface.instance.lightmapID, surface.st );
|
||||
surface.material.lightmapped = light.a > 0.001;
|
||||
if ( surface.material.lightmapped ) surface.light += surface.material.albedo * light;
|
||||
@ -280,13 +262,13 @@ void populateSurface() {
|
||||
#if !MULTISAMPLING
|
||||
surface.material.albedo *= subpassLoad(samplerAlbedo);
|
||||
#else
|
||||
surface.material.albedo *= subpassLoad(samplerAlbedo, msaa.currentID); // resolve(samplerAlbedo, ubo.msaa);
|
||||
surface.material.albedo *= subpassLoad(samplerAlbedo, msaa.currentID); // resolve(samplerAlbedo, ubo.settings.mode.msaa);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void directLighting() {
|
||||
surface.light.rgb += surface.material.albedo.rgb * ubo.ambient.rgb * surface.material.occlusion; // add ambient lighting
|
||||
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
|
||||
pbr();
|
||||
@ -300,7 +282,7 @@ void directLighting() {
|
||||
|
||||
#if MULTISAMPLING
|
||||
void resolveSurfaceFragment() {
|
||||
for ( int i = 0; i < ubo.msaa; ++i ) {
|
||||
for ( int i = 0; i < ubo.settings.mode.msaa; ++i ) {
|
||||
msaa.currentID = i;
|
||||
msaa.IDs[i] = subpassLoad(samplerId, msaa.currentID).xy;
|
||||
|
||||
@ -326,6 +308,6 @@ void resolveSurfaceFragment() {
|
||||
msaa.fragments[msaa.currentID] = surface.fragment;
|
||||
}
|
||||
|
||||
surface.fragment = msaa.fragment / ubo.msaa;
|
||||
surface.fragment = msaa.fragment / ubo.settings.mode.msaa;
|
||||
}
|
||||
#endif
|
@ -19,24 +19,6 @@ layout (binding = 0) uniform UBO {
|
||||
EyeMatrices matrices[2];
|
||||
|
||||
Settings settings;
|
||||
|
||||
uint lights;
|
||||
uint materials;
|
||||
uint textures;
|
||||
uint drawCommands;
|
||||
|
||||
vec3 ambient;
|
||||
float gamma;
|
||||
|
||||
float exposure;
|
||||
float brightnessThreshold;
|
||||
uint msaa;
|
||||
uint shadowSamples;
|
||||
|
||||
uint indexSkybox;
|
||||
uint padding1;
|
||||
uint padding2;
|
||||
uint padding3;
|
||||
} ubo;
|
||||
layout (std140, binding = 1) readonly buffer DrawCommands {
|
||||
DrawCommand drawCommands[];
|
||||
@ -133,7 +115,7 @@ void main() {
|
||||
surface.material.roughness = material.factorRoughness;
|
||||
surface.material.occlusion = material.factorOcclusion;
|
||||
|
||||
const vec3 ambient = ubo.ambient.rgb * surface.material.occlusion;
|
||||
const vec3 ambient = ubo.settings.lighting.ambient.rgb * surface.material.occlusion;
|
||||
if ( validTextureIndex( surface.instance.lightmapID ) ) {
|
||||
surface.fragment.rgb += surface.material.albedo.rgb;
|
||||
} else {
|
||||
@ -143,7 +125,7 @@ void main() {
|
||||
const vec3 F0 = mix(vec3(0.04), surface.material.albedo.rgb, surface.material.metallic);
|
||||
const vec3 Lo = normalize( surface.position.world );
|
||||
const float cosLo = max(0.0, dot(surface.normal.world, Lo));
|
||||
for ( uint i = 0; i < ubo.lights; ++i ) {
|
||||
for ( uint i = 0; i < ubo.settings.lengths.lights; ++i ) {
|
||||
const Light light = lights[i];
|
||||
if ( light.power <= LIGHT_POWER_CUTOFF ) continue;
|
||||
if ( light.type >= 0 && validTextureIndex( surface.instance.lightmapID ) ) continue;
|
||||
|
@ -13,7 +13,10 @@ layout (constant_id = 3) const uint CASCADES = 1;
|
||||
#define PBR 1
|
||||
#define VXGI 0
|
||||
#define RAYTRACE 1
|
||||
#define FOG 0
|
||||
#define FOG 1
|
||||
#define FOG_RAY_MARCH 0
|
||||
#define FOG_BASIC 1
|
||||
#define BLOOM 0
|
||||
#define WHITENOISE 0
|
||||
#define MAX_TEXTURES TEXTURES
|
||||
#define TONE_MAP 1
|
||||
@ -35,24 +38,6 @@ layout (binding = 2) uniform UBO {
|
||||
EyeMatrices eyes[2];
|
||||
|
||||
Settings settings;
|
||||
|
||||
uint lights;
|
||||
uint materials;
|
||||
uint textures;
|
||||
uint drawCommands;
|
||||
|
||||
vec3 ambient;
|
||||
float gamma;
|
||||
|
||||
float exposure;
|
||||
float brightnessThreshold;
|
||||
uint msaa;
|
||||
uint shadowSamples;
|
||||
|
||||
int indexSkybox;
|
||||
uint useLightmaps;
|
||||
uint frameNumber;
|
||||
uint padding3;
|
||||
} ubo;
|
||||
|
||||
layout (std140, binding = 3) readonly buffer Instances {
|
||||
@ -182,7 +167,7 @@ void setupSurface( RayTracePayload payload ) {
|
||||
|
||||
}
|
||||
// Lightmap
|
||||
if ( bool(ubo.useLightmaps) && validTextureIndex( surface.instance.lightmapID ) ) {
|
||||
if ( (surface.subID++ > 0 || bool(ubo.settings.lighting.useLightmaps)) && validTextureIndex( surface.instance.lightmapID ) ) {
|
||||
vec4 light = sampleTexture( surface.instance.lightmapID, surface.st );
|
||||
surface.material.lightmapped = light.a > 0.001;
|
||||
if ( surface.material.lightmapped ) surface.light += surface.material.albedo * light;
|
||||
@ -217,7 +202,7 @@ void directLighting() {
|
||||
indirectLighting();
|
||||
#endif
|
||||
|
||||
surface.light.rgb += surface.material.albedo.rgb * ubo.ambient.rgb * surface.material.occlusion; // add ambient lighting
|
||||
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
|
||||
pbr();
|
||||
@ -241,8 +226,10 @@ vec4 traceStep( Ray ray ) {
|
||||
setupSurface( payload );
|
||||
directLighting();
|
||||
outFrag = surface.fragment;
|
||||
} else if ( 0 <= ubo.indexSkybox && ubo.indexSkybox < CUBEMAPS ) {
|
||||
outFrag = texture( samplerCubemaps[ubo.indexSkybox], ray.direction );
|
||||
} else if ( 0 <= ubo.settings.lighting.indexSkybox && ubo.settings.lighting.indexSkybox < CUBEMAPS ) {
|
||||
outFrag = texture( samplerCubemaps[ubo.settings.lighting.indexSkybox], ray.direction );
|
||||
} else {
|
||||
outFrag = vec4(ubo.settings.lighting.ambient.rgb, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -261,8 +248,8 @@ vec4 traceStep( Ray ray ) {
|
||||
setupSurface( payload );
|
||||
directLighting();
|
||||
transparencyColor *= surface.fragment;
|
||||
} else if ( 0 <= ubo.indexSkybox && ubo.indexSkybox < CUBEMAPS ) {
|
||||
transparencyColor *= texture( samplerCubemaps[ubo.indexSkybox], ray.direction );
|
||||
} else if ( 0 <= ubo.settings.lighting.indexSkybox && ubo.settings.lighting.indexSkybox < CUBEMAPS ) {
|
||||
transparencyColor *= texture( samplerCubemaps[ubo.settings.lighting.indexSkybox], ray.direction );
|
||||
}
|
||||
|
||||
outFrag += transparencyColor;
|
||||
@ -291,8 +278,8 @@ vec4 traceStep( Ray ray ) {
|
||||
setupSurface( payload );
|
||||
directLighting();
|
||||
reflectionColor *= surface.fragment;
|
||||
} else if ( 0 <= ubo.indexSkybox && ubo.indexSkybox < CUBEMAPS ) {
|
||||
reflectionColor *= texture( samplerCubemaps[ubo.indexSkybox], reflection.direction );
|
||||
} else if ( 0 <= ubo.settings.lighting.indexSkybox && ubo.settings.lighting.indexSkybox < CUBEMAPS ) {
|
||||
reflectionColor *= texture( samplerCubemaps[ubo.settings.lighting.indexSkybox], reflection.direction );
|
||||
}
|
||||
|
||||
outFrag += reflectionColor;
|
||||
@ -306,27 +293,29 @@ vec4 traceStep( Ray ray ) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
// if ( ubo.frameNumber > 16 ) return;
|
||||
// prngSeed = tea(gl_LaunchIDEXT.y * gl_LaunchSizeEXT.x + gl_LaunchIDEXT.x, ubo.frameNumber);
|
||||
// if ( ubo.settings.mode.frameNumber > 16 ) return;
|
||||
// prngSeed = tea(gl_LaunchIDEXT.y * gl_LaunchSizeEXT.x + gl_LaunchIDEXT.x, ubo.settings.mode.frameNumber);
|
||||
prngSeed = tea(gl_LaunchIDEXT.y * gl_LaunchSizeEXT.x + gl_LaunchIDEXT.x, int(clockARB()));
|
||||
surface.pass = PushConstant.pass;
|
||||
surface.subID = 0;
|
||||
vec4 outFrag = vec4(0);
|
||||
|
||||
const uint SAMPLES = ubo.settings.rt.samples;
|
||||
const uint NUM_PATHS = ubo.settings.rt.paths;
|
||||
const uint SAMPLES = min(ubo.settings.rt.samples, 4);
|
||||
const uint NUM_PATHS = min(ubo.settings.rt.paths, 8);
|
||||
#if 1
|
||||
const uint FRAME_ACCUMULATION_VALUE = ubo.settings.rt.frameAccumulationMinimum > 0 ? min(ubo.settings.rt.frameAccumulationMinimum, ubo.frameNumber + 1) : ubo.frameNumber + 1;
|
||||
const uint FRAME_ACCUMULATION_VALUE = ubo.settings.rt.frameAccumulationMinimum > 0 ? min(ubo.settings.rt.frameAccumulationMinimum, ubo.settings.mode.frameNumber + 1) : ubo.settings.mode.frameNumber + 1;
|
||||
#else
|
||||
const uint FRAME_ACCUMULATION_VALUE = min(32, ubo.frameNumber + 1);
|
||||
const uint FRAME_ACCUMULATION_VALUE = min(32, ubo.settings.mode.frameNumber + 1);
|
||||
#endif
|
||||
const float BLEND_FACTOR = 1.0f / float(FRAME_ACCUMULATION_VALUE);
|
||||
uint FRAME_NUMBER = ubo.frameNumber;
|
||||
uint FRAME_NUMBER = ubo.settings.mode.frameNumber;
|
||||
|
||||
#if 0
|
||||
for ( uint samp = 0; samp < SAMPLES; ++samp, ++FRAME_NUMBER ) {
|
||||
{
|
||||
const vec2 center = ( FRAME_NUMBER > 0 ) ? vec2( rnd(), rnd() ) : vec2(0.5);
|
||||
const vec2 inUv = (vec2(gl_LaunchIDEXT.xy) + center) / vec2(gl_LaunchSizeEXT.xy);
|
||||
#if 0
|
||||
#if 1
|
||||
vec4 target = ubo.eyes[surface.pass].iProjection * vec4(inUv.x * 2.0f - 1.0f, inUv.y * 2.0f - 1.0f, 1, 1);
|
||||
vec4 direction = ubo.eyes[surface.pass].iView * vec4(normalize(target.xyz), 0);
|
||||
|
||||
@ -362,11 +351,77 @@ void main() {
|
||||
outFrag += curValue;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
outFrag /= SAMPLES;
|
||||
outFrag.a = 1;
|
||||
}
|
||||
#elif 0
|
||||
{
|
||||
const vec2 center = ( FRAME_NUMBER > 0 ) ? vec2( rnd(), rnd() ) : vec2(0.5);
|
||||
const vec2 inUv = (vec2(gl_LaunchIDEXT.xy) + center) / vec2(gl_LaunchSizeEXT.xy);
|
||||
#if 0
|
||||
vec4 target = ubo.eyes[surface.pass].iProjection * vec4(inUv.x * 2.0f - 1.0f, inUv.y * 2.0f - 1.0f, 1, 1);
|
||||
vec4 direction = ubo.eyes[surface.pass].iView * vec4(normalize(target.xyz), 0);
|
||||
|
||||
surface.ray.direction = vec3(direction);
|
||||
surface.ray.origin = ubo.eyes[surface.pass].eyePos.xyz;
|
||||
#else
|
||||
const mat4 iProjectionView = inverse( ubo.eyes[surface.pass].projection * mat4(mat3(ubo.eyes[surface.pass].view)) );
|
||||
const vec4 near4 = iProjectionView * (vec4(2.0 * inUv - 1.0, -1.0, 1.0));
|
||||
const vec4 far4 = iProjectionView * (vec4(2.0 * inUv - 1.0, 1.0, 1.0));
|
||||
const vec3 near3 = near4.xyz / near4.w;
|
||||
const vec3 far3 = far4.xyz / far4.w;
|
||||
|
||||
surface.ray.direction = normalize( far3 - near3 );
|
||||
surface.ray.origin = ubo.eyes[surface.pass].eyePos.xyz;
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
vec4 curValue = vec4(0);
|
||||
vec4 curWeight = vec4(1);
|
||||
for ( uint path = 0; path < NUM_PATHS; ++path ) {
|
||||
vec4 stepValue = traceStep( surface.ray );
|
||||
curValue += stepValue * curWeight;
|
||||
|
||||
if ( !payload.hit ) break;
|
||||
|
||||
surface.ray.origin = surface.position.world;
|
||||
surface.ray.direction = samplingHemisphere( prngSeed, surface.normal.world );
|
||||
curWeight *= surface.material.albedo * dot( surface.ray.direction, surface.normal.world );
|
||||
|
||||
if ( length(curWeight) < 0.01 ) break;
|
||||
}
|
||||
outFrag += curValue;
|
||||
}
|
||||
{
|
||||
surface.fragment = outFrag;
|
||||
}
|
||||
#else
|
||||
{
|
||||
const vec2 center = ( FRAME_NUMBER > 0 ) ? vec2( rnd(), rnd() ) : vec2(0.5);
|
||||
const vec2 inUv = (vec2(gl_LaunchIDEXT.xy) + center) / vec2(gl_LaunchSizeEXT.xy);
|
||||
#if 0
|
||||
vec4 target = ubo.eyes[surface.pass].iProjection * vec4(inUv.x * 2.0f - 1.0f, inUv.y * 2.0f - 1.0f, 1, 1);
|
||||
vec4 direction = ubo.eyes[surface.pass].iView * vec4(normalize(target.xyz), 0);
|
||||
|
||||
surface.ray.direction = vec3(direction);
|
||||
surface.ray.origin = ubo.eyes[surface.pass].eyePos.xyz;
|
||||
#else
|
||||
const mat4 iProjectionView = inverse( ubo.eyes[surface.pass].projection * mat4(mat3(ubo.eyes[surface.pass].view)) );
|
||||
const vec4 near4 = iProjectionView * (vec4(2.0 * inUv - 1.0, -1.0, 1.0));
|
||||
const vec4 far4 = iProjectionView * (vec4(2.0 * inUv - 1.0, 1.0, 1.0));
|
||||
const vec3 near3 = near4.xyz / near4.w;
|
||||
const vec3 far3 = far4.xyz / far4.w;
|
||||
|
||||
surface.ray.direction = normalize( far3 - near3 );
|
||||
surface.ray.origin = ubo.eyes[surface.pass].eyePos.xyz;
|
||||
#endif
|
||||
}
|
||||
{
|
||||
surface.fragment = traceStep( surface.ray );
|
||||
}
|
||||
#endif
|
||||
{
|
||||
#if BLOOM
|
||||
float brightness = dot(surface.fragment.rgb, vec3(0.2126, 0.7152, 0.0722));
|
||||
outFragBright = brightness > ubo.brightnessThreshold ? vec4(surface.fragment.rgb, 1.0) : vec4(0, 0, 0, 1);
|
||||
@ -375,17 +430,22 @@ void main() {
|
||||
fog( surface.ray, surface.fragment.rgb, surface.fragment.a );
|
||||
#endif
|
||||
#if TONE_MAP
|
||||
surface.fragment.rgb = vec3(1.0) - exp(-surface.fragment.rgb * ubo.exposure);
|
||||
surface.fragment.rgb = vec3(1.0) - exp(-surface.fragment.rgb * ubo.settings.bloom.exposure);
|
||||
#endif
|
||||
#if GAMMA_CORRECT
|
||||
surface.fragment.rgb = pow(surface.fragment.rgb, vec3(1.0 / ubo.gamma));
|
||||
surface.fragment.rgb = pow(surface.fragment.rgb, vec3(1.0 / ubo.settings.bloom.gamma));
|
||||
#endif
|
||||
#if WHITENOISE
|
||||
if ( enabled(ubo.settings.mode.type, 1) ) whitenoise(surface.fragment.rgb, ubo.settings.mode.parameters);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( ubo.frameNumber == 0 ) {
|
||||
{
|
||||
outFrag = surface.fragment;
|
||||
outFrag.a = 1;
|
||||
}
|
||||
|
||||
if ( ubo.settings.mode.frameNumber == 0 ) {
|
||||
imageStore(outImage, ivec2(gl_LaunchIDEXT.xy), outFrag);
|
||||
} else {
|
||||
// if ( length(outFrag.rgb) < 0.01f ) return;
|
||||
@ -393,38 +453,4 @@ void main() {
|
||||
|
||||
imageStore(outImage, ivec2(gl_LaunchIDEXT.xy), blended);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
{
|
||||
vec4 curValue = vec4(0);
|
||||
vec4 curWeight = vec4(1);
|
||||
for ( uint path = 0; path < NUM_PATHS; ++path ) {
|
||||
trace( surface.ray );
|
||||
|
||||
if ( !payload.hit ) {
|
||||
if ( path == 0 && 0 <= ubo.indexSkybox && ubo.indexSkybox < CUBEMAPS ) {
|
||||
curValue = texture( samplerCubemaps[ubo.indexSkybox], surface.ray.direction );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
setupSurface( payload );
|
||||
directLighting();
|
||||
curValue += surface.fragment * curWeight;
|
||||
|
||||
surface.ray.origin = surface.position.world;
|
||||
if ( !false ) {
|
||||
surface.ray.direction = reflect( surface.ray.direction, surface.normal.world );
|
||||
curWeight *= (1.0 - surface.material.roughness) * surface.material.albedo * dot( surface.ray.direction, surface.normal.world );
|
||||
} else {
|
||||
surface.ray.direction = samplingHemisphere( prngSeed, surface.normal.world );
|
||||
curWeight *= surface.material.albedo * dot( surface.ray.direction, surface.normal.world );
|
||||
}
|
||||
|
||||
|
||||
if ( length(curWeight) < 0.01 ) break;
|
||||
}
|
||||
outFrag += curValue;
|
||||
}
|
||||
*/
|
||||
}
|
@ -745,6 +745,7 @@ void uf::graph::process( pod::Graph& graph ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( graph.metadata["debug"]["print"]["lights"].as<bool>() ) for ( auto& pair : graph.lights ) UF_MSG_DEBUG("Light: {}", pair.first);
|
||||
if ( graph.metadata["debug"]["print"]["meshes"].as<bool>() ) for ( auto& name : graph.meshes ) UF_MSG_DEBUG("Mesh: {}", name);
|
||||
if ( graph.metadata["debug"]["print"]["materials"].as<bool>() ) for ( auto& name : graph.materials ) UF_MSG_DEBUG("Material: {}", name);
|
||||
if ( graph.metadata["debug"]["print"]["textures"].as<bool>() ) for ( auto& name : graph.textures ) UF_MSG_DEBUG("Texture: {}", name);
|
||||
|
@ -1288,7 +1288,6 @@ void ext::vulkan::Graphic::generateBottomAccelerationStructures() {
|
||||
// create BLAS buffer and handle
|
||||
size_t blasBufferIndex = this->initializeBuffer( NULL, totalBlasBufferSize, uf::renderer::enums::Buffer::ACCELERATION_STRUCTURE | uf::renderer::enums::Buffer::ADDRESS );
|
||||
size_t blasBufferOffset = 0;
|
||||
UF_MSG_DEBUG("Blas buffer size: {}", totalBlasBufferSize);
|
||||
#endif
|
||||
|
||||
scratchBuffer.alignment = acclerationStructureProperties.minAccelerationStructureScratchOffsetAlignment;
|
||||
@ -1307,7 +1306,6 @@ void ext::vulkan::Graphic::generateBottomAccelerationStructures() {
|
||||
|
||||
blasBufferOffset += blasData.sizeInfo.accelerationStructureSize;
|
||||
#else
|
||||
UF_MSG_DEBUG("Blas buffer size: {}", blasData.sizeInfo.accelerationStructureSize);
|
||||
size_t blasBufferIndex = this->initializeBuffer( NULL, blasData.sizeInfo.accelerationStructureSize, uf::renderer::enums::Buffer::ACCELERATION_STRUCTURE | uf::renderer::enums::Buffer::ADDRESS );
|
||||
blasData.as.buffer = this->buffers[blasBufferIndex].alias();
|
||||
|
||||
@ -1338,7 +1336,6 @@ void ext::vulkan::Graphic::generateBottomAccelerationStructures() {
|
||||
&blasData.rangeInfo
|
||||
);
|
||||
device.flushCommandBuffer(commandBuffer, uf::renderer::Device::QueueEnum::COMPUTE);
|
||||
|
||||
}
|
||||
|
||||
for ( auto& blasData : blasDatas ) this->accelerationStructures.bottoms.emplace_back(blasData.as);
|
||||
|
@ -727,13 +727,32 @@ void ext::ExtSceneBehavior::bindBuffers( uf::Object& self, uf::renderer::Graphic
|
||||
} matrices[2];
|
||||
|
||||
struct Settings {
|
||||
struct Lengths {
|
||||
alignas(4) uint32_t lights = 0;
|
||||
alignas(4) uint32_t materials = 0;
|
||||
alignas(4) uint32_t textures = 0;
|
||||
alignas(4) uint32_t drawCommands = 0;
|
||||
} lengths;
|
||||
|
||||
struct Mode {
|
||||
alignas(4) uint8_t mode;
|
||||
alignas(4) uint8_t scalar;
|
||||
alignas(8) pod::Vector2ui padding;
|
||||
alignas(16) pod::Vector4f parameters;
|
||||
|
||||
alignas(4) uint32_t mode;
|
||||
alignas(4) uint32_t scalar;
|
||||
|
||||
alignas(4) uint32_t msaa;
|
||||
alignas(4) uint32_t frameAccumulate;
|
||||
} mode;
|
||||
|
||||
struct Lighting {
|
||||
pod::Vector3f ambient;
|
||||
alignas(4) float padding1;
|
||||
|
||||
alignas(4) uint32_t indexSkybox;
|
||||
alignas(4) uint32_t shadowSamples;
|
||||
alignas(4) uint32_t useLightmaps;
|
||||
} lighting;
|
||||
|
||||
struct Fog {
|
||||
pod::Vector3f color;
|
||||
alignas(4) float stepScale;
|
||||
@ -751,6 +770,13 @@ void ext::ExtSceneBehavior::bindBuffers( uf::Object& self, uf::renderer::Graphic
|
||||
alignas(4) float padding3;
|
||||
} fog;
|
||||
|
||||
struct Bloom {
|
||||
alignas(4) float exposure;
|
||||
alignas(4) float brightnessThreshold;
|
||||
alignas(4) float gamma;
|
||||
alignas(4) uint32_t padding2;
|
||||
} bloom;
|
||||
|
||||
struct VXGI {
|
||||
alignas(16) pod::Matrix4f matrix;
|
||||
alignas(4) float cascadePower;
|
||||
@ -775,26 +801,6 @@ void ext::ExtSceneBehavior::bindBuffers( uf::Object& self, uf::renderer::Graphic
|
||||
alignas(4) uint padding2;
|
||||
} rt;
|
||||
} settings;
|
||||
|
||||
struct Lengths {
|
||||
alignas(4) uint32_t lights = 0;
|
||||
alignas(4) uint32_t materials = 0;
|
||||
alignas(4) uint32_t textures = 0;
|
||||
alignas(4) uint32_t drawCommands = 0;
|
||||
} lengths;
|
||||
|
||||
pod::Vector3f ambient;
|
||||
alignas(4) float gamma;
|
||||
|
||||
alignas(4) float exposure;
|
||||
alignas(4) float brightnessThreshold;
|
||||
alignas(4) uint32_t msaa;
|
||||
alignas(4) uint32_t shadowSamples;
|
||||
|
||||
alignas(4) uint32_t indexSkybox;
|
||||
alignas(4) uint32_t useLightmaps;
|
||||
alignas(4) uint32_t frameAccumulate;
|
||||
alignas(4) uint32_t padding3;
|
||||
};
|
||||
|
||||
// struct that contains our skybox cubemap, noise texture, and VXGI voxels
|
||||
@ -848,11 +854,27 @@ void ext::ExtSceneBehavior::bindBuffers( uf::Object& self, uf::renderer::Graphic
|
||||
.eyePos = camera.getEye( i ),
|
||||
};
|
||||
}
|
||||
uniforms.settings.lengths = UniformDescriptor::Settings::Lengths{
|
||||
.lights = MIN( uf::graph::storage.lights.size(), metadata.light.max ),
|
||||
.materials = MIN( uf::graph::storage.materials.keys.size(), metadata.max.textures2D ),
|
||||
.textures = MIN( uf::graph::storage.textures.keys.size(), metadata.max.textures2D ),
|
||||
.drawCommands = MIN( 0, metadata.max.textures2D ),
|
||||
};
|
||||
uniforms.settings.mode = UniformDescriptor::Settings::Mode{
|
||||
.parameters = metadata.shader.parameters,
|
||||
|
||||
.mode = metadata.shader.mode,
|
||||
.scalar = metadata.shader.scalar,
|
||||
.padding = pod::Vector2ui{0,0},
|
||||
.parameters = metadata.shader.parameters,
|
||||
|
||||
.msaa = ext::vulkan::settings::msaa,
|
||||
.frameAccumulate = metadata.shader.frameAccumulate,
|
||||
};
|
||||
uniforms.settings.lighting = UniformDescriptor::Settings::Lighting{
|
||||
.ambient = metadata.light.ambient,
|
||||
|
||||
.indexSkybox = indexSkybox,
|
||||
.shadowSamples = std::min( 0, metadata.shadow.samples ),
|
||||
.useLightmaps = metadata.light.useLightmaps,
|
||||
};
|
||||
uniforms.settings.fog = UniformDescriptor::Settings::Fog{
|
||||
.color = metadata.fog.color,
|
||||
@ -867,7 +889,11 @@ void ext::ExtSceneBehavior::bindBuffers( uf::Object& self, uf::renderer::Graphic
|
||||
|
||||
.absorbtion = metadata.fog.absorbtion,
|
||||
};
|
||||
|
||||
uniforms.settings.bloom = UniformDescriptor::Settings::Bloom{
|
||||
.exposure = metadata.light.exposure,
|
||||
.brightnessThreshold = metadata.light.brightnessThreshold,
|
||||
.gamma = metadata.light.gamma,
|
||||
};
|
||||
uniforms.settings.vxgi = UniformDescriptor::Settings::VXGI{
|
||||
.matrix = metadataVxgi.extents.matrix,
|
||||
.cascadePower = metadataVxgi.cascadePower,
|
||||
@ -878,7 +904,6 @@ void ext::ExtSceneBehavior::bindBuffers( uf::Object& self, uf::renderer::Graphic
|
||||
.traceStartOffsetFactor = metadataVxgi.traceStartOffsetFactor,
|
||||
.shadows = metadataVxgi.shadows,
|
||||
};
|
||||
|
||||
uniforms.settings.rt = UniformDescriptor::Settings::RT{
|
||||
.defaultRayBounds = metadataRt.settings.defaultRayBounds, // { 0.001, 4096.0 },
|
||||
.alphaTestOffset = metadataRt.settings.alphaTestOffset, //0.001,
|
||||
@ -887,26 +912,7 @@ void ext::ExtSceneBehavior::bindBuffers( uf::Object& self, uf::renderer::Graphic
|
||||
.paths = metadataRt.settings.paths, // 1,
|
||||
.frameAccumulationMinimum = metadataRt.settings.frameAccumulationMinimum, // 0,
|
||||
};
|
||||
|
||||
uniforms.lengths = UniformDescriptor::Lengths{
|
||||
.lights = MIN( uf::graph::storage.lights.size(), metadata.light.max ),
|
||||
.materials = MIN( uf::graph::storage.materials.keys.size(), metadata.max.textures2D ),
|
||||
.textures = MIN( uf::graph::storage.textures.keys.size(), metadata.max.textures2D ),
|
||||
.drawCommands = MIN( 0, metadata.max.textures2D ),
|
||||
};
|
||||
|
||||
uniforms.ambient = metadata.light.ambient;
|
||||
uniforms.gamma = metadata.light.gamma;
|
||||
|
||||
uniforms.exposure = metadata.light.exposure;
|
||||
uniforms.brightnessThreshold = metadata.light.brightnessThreshold;
|
||||
uniforms.msaa = ext::vulkan::settings::msaa;
|
||||
uniforms.shadowSamples = std::min( 0, metadata.shadow.samples );
|
||||
|
||||
uniforms.indexSkybox = indexSkybox;
|
||||
// use sample lightmaps during deferred pass
|
||||
uniforms.useLightmaps = metadata.light.useLightmaps;
|
||||
uniforms.frameAccumulate = metadata.shader.frameAccumulate;
|
||||
}
|
||||
|
||||
uf::stl::vector<VkImage> previousTextures;
|
||||
|
@ -828,9 +828,6 @@ void EXT_API ext::terminate() {
|
||||
/* Terminate controllers */ {
|
||||
spec::controller::terminate();
|
||||
}
|
||||
/* Kill physics */ {
|
||||
uf::physics::terminate();
|
||||
}
|
||||
#if UF_USE_IMGUI
|
||||
if ( ::config.engine.ext.imgui.enabled ) {
|
||||
ext::imgui::terminate();
|
||||
@ -860,7 +857,9 @@ void EXT_API ext::terminate() {
|
||||
{
|
||||
uf::scene::destroy();
|
||||
}
|
||||
|
||||
/* Kill physics */ {
|
||||
uf::physics::terminate();
|
||||
}
|
||||
/* Garbage collection */ if ( false ) { // segfaults, for some reason
|
||||
size_t collected = uf::instantiator::collect( ::config.engine.gc.mode );
|
||||
if ( ::config.engine.gc.announce && collected > 0 ) UF_MSG_DEBUG("GC collected {} unused entities", (int) collected);
|
||||
|
Loading…
Reference in New Issue
Block a user