Cleanup
This commit is contained in:
@@ -4,5 +4,4 @@
|
|||||||
void main(SPIRV_Cross_Input stage_input) {
|
void main(SPIRV_Cross_Input stage_input) {
|
||||||
if (abs(stage_input.wpos.z) > 1.0 || abs(stage_input.wpos.x) > 1 || abs(stage_input.wpos.y) > 1) return;
|
if (abs(stage_input.wpos.z) > 1.0 || abs(stage_input.wpos.x) > 1 || abs(stage_input.wpos.y) > 1) return;
|
||||||
voxels[int3(256, 256, 256) * (stage_input.wpos * 0.5 + 0.5)] = 1.0;
|
voxels[int3(256, 256, 256) * (stage_input.wpos * 0.5 + 0.5)] = 1.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -189,9 +189,11 @@ vec3 brightcontrast(const vec3 col, const float bright, const float contr) {
|
|||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static var str_traceAO = "
|
static inline var voxRes = arm.render.Inc.getVoxelRes();
|
||||||
|
|
||||||
|
public static var str_traceAO = '
|
||||||
float traceConeAO(sampler3D voxels, const vec3 origin, vec3 dir, const float aperture, const float maxDist, const float offset) {
|
float traceConeAO(sampler3D voxels, const vec3 origin, vec3 dir, const float aperture, const float maxDist, const float offset) {
|
||||||
const ivec3 voxelgiResolution = ivec3(256, 256, 256);
|
const ivec3 voxelgiResolution = ivec3($voxRes, $voxRes, $voxRes);
|
||||||
const float voxelgiStep = 1.0;
|
const float voxelgiStep = 1.0;
|
||||||
const float VOXEL_SIZE = (2.0 / voxelgiResolution.x) * voxelgiStep;
|
const float VOXEL_SIZE = (2.0 / voxelgiResolution.x) * voxelgiStep;
|
||||||
dir = normalize(dir);
|
dir = normalize(dir);
|
||||||
@@ -223,7 +225,7 @@ float traceAO(const vec3 origin, const vec3 normal, const float vrange, const fl
|
|||||||
vec3 c1 = 0.5f * (o1 + o2);
|
vec3 c1 = 0.5f * (o1 + o2);
|
||||||
vec3 c2 = 0.5f * (o1 - o2);
|
vec3 c2 = 0.5f * (o1 - o2);
|
||||||
float MAX_DISTANCE = 1.73205080757 * 2.0 * vrange;
|
float MAX_DISTANCE = 1.73205080757 * 2.0 * vrange;
|
||||||
const ivec3 voxelgiResolution = ivec3(256, 256, 256);
|
const ivec3 voxelgiResolution = ivec3($voxRes, $voxRes, $voxRes);
|
||||||
const float voxelgiStep = 1.0;
|
const float voxelgiStep = 1.0;
|
||||||
const float VOXEL_SIZE = (2.0 / voxelgiResolution.x) * voxelgiStep;
|
const float VOXEL_SIZE = (2.0 / voxelgiResolution.x) * voxelgiStep;
|
||||||
float offset = 1.5 * VOXEL_SIZE * 2.5 * voffset;
|
float offset = 1.5 * VOXEL_SIZE * 2.5 * voffset;
|
||||||
@@ -238,7 +240,7 @@ float traceAO(const vec3 origin, const vec3 normal, const float vrange, const fl
|
|||||||
col += traceConeAO(voxels, origin, mix(normal, c2, angleMix), aperture, MAX_DISTANCE, offset);
|
col += traceConeAO(voxels, origin, mix(normal, c2, angleMix), aperture, MAX_DISTANCE, offset);
|
||||||
return col / 9.0;
|
return col / 9.0;
|
||||||
}
|
}
|
||||||
";
|
';
|
||||||
|
|
||||||
public static var str_cotangentFrame = "
|
public static var str_cotangentFrame = "
|
||||||
mat3 cotangentFrame(const vec3 n, const vec3 p, const vec2 duv1, const vec2 duv2) {
|
mat3 cotangentFrame(const vec3 n, const vec3 p, const vec2 duv1, const vec2 duv2) {
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ class RenderPathPaint {
|
|||||||
}
|
}
|
||||||
path.clearImage("voxels", 0x00000000);
|
path.clearImage("voxels", 0x00000000);
|
||||||
path.setTarget("");
|
path.setTarget("");
|
||||||
path.setViewport(256, 256);
|
path.setViewport(Inc.getVoxelRes(), Inc.getVoxelRes());
|
||||||
path.bindTarget("voxels", "voxels");
|
path.bindTarget("voxels", "voxels");
|
||||||
path.drawMeshes("voxel");
|
path.drawMeshes("voxel");
|
||||||
path.generateMipmaps("voxels");
|
path.generateMipmaps("voxels");
|
||||||
|
|||||||
Reference in New Issue
Block a user