Use latest Kha
This commit is contained in:
parent
39ed5be430
commit
ba4a8c2e22
|
@ -9,12 +9,12 @@
|
|||
uniform vec4 casData[shadowmapCascades * 4 + 4];
|
||||
#endif
|
||||
|
||||
float shadowCompare(sampler2D shadowMap, const vec2 uv, const float compare){
|
||||
float shadowCompare(sampler2D shadowMap, const vec2 uv, const float compare) {
|
||||
float depth = texture(shadowMap, uv).r;
|
||||
return step(compare, depth);
|
||||
}
|
||||
|
||||
float shadowLerp(sampler2D shadowMap, const vec2 uv, const float compare, const vec2 smSize){
|
||||
float shadowLerp(sampler2D shadowMap, const vec2 uv, const float compare, const vec2 smSize) {
|
||||
const vec2 texelSize = vec2(1.0) / smSize;
|
||||
vec2 f = fract(uv * smSize + 0.5);
|
||||
vec2 centroidUV = floor(uv * smSize + 0.5) / smSize;
|
||||
|
|
|
@ -16,7 +16,7 @@ class MeshNode extends LogicNode {
|
|||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
iron.data.Data.getMesh("mesh_" + property0, property0, null, function(mesh:MeshData) {
|
||||
iron.data.Data.getMesh("mesh_" + property0, property0, function(mesh:MeshData) {
|
||||
value = mesh;
|
||||
});
|
||||
|
||||
|
|
|
@ -283,7 +283,6 @@ class Inc {
|
|||
#end
|
||||
}
|
||||
|
||||
#if cpp
|
||||
#if (rp_gi == "Voxel GI")
|
||||
public static function computeVoxels() {
|
||||
if (voxel_sh == null) {
|
||||
|
@ -402,7 +401,6 @@ class Inc {
|
|||
#end
|
||||
}
|
||||
#end
|
||||
#end // cpp
|
||||
|
||||
#if (rp_renderer == "Forward")
|
||||
public static function drawShadowMap(l:iron.object.LampObject) {
|
||||
|
|
|
@ -41,14 +41,12 @@ class RenderPathDeferred {
|
|||
Inc.initGI("voxelsB");
|
||||
}
|
||||
#end
|
||||
#if cpp
|
||||
#if (rp_gi == "Voxel GI")
|
||||
{
|
||||
Inc.initGI("voxelsOpac");
|
||||
Inc.initGI("voxelsNor");
|
||||
}
|
||||
#end
|
||||
#end //cpp
|
||||
}
|
||||
#end
|
||||
|
||||
|
@ -472,7 +470,6 @@ class RenderPathDeferred {
|
|||
}
|
||||
#end
|
||||
|
||||
#if cpp
|
||||
if (voxelize) {
|
||||
|
||||
var res = Inc.getVoxelRes();
|
||||
|
@ -498,22 +495,6 @@ class RenderPathDeferred {
|
|||
path.generateMipmaps(voxels);
|
||||
#end
|
||||
}
|
||||
#else
|
||||
if (voxelize) {
|
||||
path.clearImage(voxels, 0x00000000);
|
||||
path.setTarget("");
|
||||
var res = Inc.getVoxelRes();
|
||||
path.setViewport(res, res);
|
||||
path.bindTarget(voxels, "voxels");
|
||||
#if ((rp_shadowmap) && (rp_gi == "Voxel GI"))
|
||||
{
|
||||
Inc.bindShadowMap();
|
||||
}
|
||||
#end
|
||||
path.drawMeshes("voxel");
|
||||
path.generateMipmaps(voxels);
|
||||
}
|
||||
#end //cpp
|
||||
}
|
||||
#end
|
||||
|
||||
|
|
|
@ -89,14 +89,12 @@ class RenderPathForward {
|
|||
Inc.initGI("voxelsB");
|
||||
}
|
||||
#end
|
||||
#if cpp
|
||||
#if (rp_gi == "Voxel GI")
|
||||
{
|
||||
Inc.initGI("voxelsOpac");
|
||||
Inc.initGI("voxelsNor");
|
||||
}
|
||||
#end
|
||||
#end //cpp
|
||||
}
|
||||
#end
|
||||
|
||||
|
@ -220,7 +218,6 @@ class RenderPathForward {
|
|||
}
|
||||
#end
|
||||
|
||||
#if cpp
|
||||
if (voxelize) {
|
||||
var res = Inc.getVoxelRes();
|
||||
|
||||
|
@ -245,22 +242,6 @@ class RenderPathForward {
|
|||
path.generateMipmaps(voxels);
|
||||
#end
|
||||
}
|
||||
#else
|
||||
if (voxelize) {
|
||||
path.clearImage(voxels, 0x00000000);
|
||||
path.setTarget("");
|
||||
var res = Inc.getVoxelRes();
|
||||
path.setViewport(res, res);
|
||||
path.bindTarget(voxels, "voxels");
|
||||
#if ((rp_shadowmap) && (rp_gi == "Voxel GI"))
|
||||
{
|
||||
Inc.bindShadowMap();
|
||||
}
|
||||
#end
|
||||
path.drawMeshes("voxel");
|
||||
path.generateMipmaps(voxels);
|
||||
}
|
||||
#end // cpp
|
||||
}
|
||||
#end
|
||||
|
||||
|
|
|
@ -521,11 +521,11 @@ class ConvexBreaker {
|
|||
}
|
||||
|
||||
// TODO:
|
||||
var paa = new TFloat32Array(pa.length);
|
||||
var paa = new kha.arrays.Float32Array(pa.length);
|
||||
for (i in 0...pa.length) paa.set(i, pa[i]);
|
||||
var naa = new TFloat32Array(na.length);
|
||||
var naa = new kha.arrays.Float32Array(na.length);
|
||||
for (i in 0...na.length) naa.set(i, na[i]);
|
||||
var inda = new TUint32Array(ind.length);
|
||||
var inda = new kha.arrays.Uint32Array(ind.length);
|
||||
for (i in 0...ind.length) inda.set(i, ind[i]);
|
||||
|
||||
var pos:TVertexArray = {
|
||||
|
|
|
@ -56,7 +56,6 @@ class ThirdPersonController extends CameraController {
|
|||
|
||||
var mouse = Input.getMouse();
|
||||
if (mouse.down()) {
|
||||
// kha.SystemImpl.lockMouse();
|
||||
camera.transform.rotate(xVec, mouse.movementY / 250 * rotationSpeed);
|
||||
transform.rotate(zVec, -mouse.movementX / 250 * rotationSpeed);
|
||||
camera.buildMatrix();
|
||||
|
|
|
@ -50,9 +50,15 @@ class PhysicsWorld extends Trait {
|
|||
public function new() {
|
||||
super();
|
||||
|
||||
if (active != null) return;
|
||||
if (active == null) {
|
||||
createPhysics();
|
||||
}
|
||||
else {
|
||||
for (rb in active.rbMap) removeRigidBody(rb);
|
||||
world = active.world;
|
||||
dispatcher = active.dispatcher;
|
||||
}
|
||||
|
||||
createPhysics();
|
||||
contacts = [];
|
||||
rbMap = new Map();
|
||||
active = this;
|
||||
|
@ -111,7 +117,7 @@ class PhysicsWorld extends Trait {
|
|||
public function removeRigidBody(body:RigidBody) {
|
||||
if (world != null) world.removeRigidBody(body.body);
|
||||
#if js
|
||||
Ammo.destroy(body.body);
|
||||
// Ammo.destroy(body.body);
|
||||
#elseif cpp
|
||||
// body.body.destroy(); // delete body;
|
||||
#end
|
||||
|
|
|
@ -45,16 +45,16 @@ class SoftBody extends Trait {
|
|||
});
|
||||
}
|
||||
|
||||
function fromF32(ar:TFloat32Array):haxe.ds.Vector<kha.FastFloat> {
|
||||
var vals = new haxe.ds.Vector<kha.FastFloat>(ar.length);
|
||||
function fromF32(ar:kha.arrays.Float32Array):kha.arrays.Float32Array {
|
||||
var vals = new kha.arrays.Float32Array(ar.length);
|
||||
for (i in 0...vals.length) vals[i] = ar[i];
|
||||
return vals;
|
||||
}
|
||||
|
||||
function fromU32(ars:Array<TUint32Array>):haxe.ds.Vector<Int> {
|
||||
function fromU32(ars:Array<kha.arrays.Uint32Array>):kha.arrays.Uint32Array {
|
||||
var len = 0;
|
||||
for (ar in ars) len += ar.length;
|
||||
var vals = new haxe.ds.Vector<Int>(len);
|
||||
var vals = new kha.arrays.Uint32Array(len);
|
||||
var i = 0;
|
||||
for (ar in ars) {
|
||||
for (j in 0...ar.length) {
|
||||
|
@ -113,9 +113,9 @@ class SoftBody extends Trait {
|
|||
|
||||
var softBodyHelpers = BtSoftBodyHelpers.create();
|
||||
#if js
|
||||
body = softBodyHelpers.CreateFromTriMesh(wrdinfo, positions, vecind, numtri);
|
||||
body = softBodyHelpers.CreateFromTriMesh(wrdinfo, cast positions, cast vecind, numtri);
|
||||
#elseif cpp
|
||||
untyped __cpp__("body = softBodyHelpers.CreateFromTriMesh(wrdinfo, positions->Pointer(), vecind->Pointer(), numtri);");
|
||||
untyped __cpp__("body = softBodyHelpers.CreateFromTriMesh(wrdinfo, positions->self.data, vecind->self.data, numtri);");
|
||||
#end
|
||||
|
||||
// body.generateClusters(4);
|
||||
|
|
|
@ -56,7 +56,7 @@ class Vertex:
|
|||
self.co = mesh.vertices[self.vertex_index].co[:]
|
||||
self.normal = loop.normal[:]
|
||||
self.uvs = tuple(layer.data[loop_idx].uv[:] for layer in mesh.uv_layers)
|
||||
self.col = [0, 0, 0]
|
||||
self.col = [0.0, 0.0, 0.0]
|
||||
if len(mesh.vertex_colors) > 0:
|
||||
self.col = mesh.vertex_colors[0].data[loop_idx].color[:]
|
||||
# self.colors = tuple(layer.data[loop_idx].color[:] for layer in mesh.vertex_colors)
|
||||
|
@ -865,7 +865,7 @@ class ArmoryExporter:
|
|||
for i in range(0, num_psys):
|
||||
self.export_particle_system_ref(bobject.particle_systems[i], i, o)
|
||||
|
||||
o['dimensions'] = [0, 0, 0]
|
||||
o['dimensions'] = [0.0, 0.0, 0.0]
|
||||
for i in range(0, 3):
|
||||
if bobject.scale[i] != 0:
|
||||
o['dimensions'][i] = bobject.dimensions[i] / bobject.scale[i]
|
||||
|
@ -1583,7 +1583,7 @@ class ArmoryExporter:
|
|||
o['lamp_size'] = objref.shadow_soft_size * 10 # Match to Cycles
|
||||
gapi = arm.utils.get_gapi()
|
||||
mobile_mat = rpdat.arm_material_model == 'Mobile' or rpdat.arm_material_model == 'Solid'
|
||||
if objtype == 'POINT' and objref.arm_omni_shadows and not gapi.startswith('direct3d') and not mobile_mat:
|
||||
if objtype == 'POINT' and objref.arm_omni_shadows and not mobile_mat:
|
||||
o['fov'] = 1.5708 # 90 deg
|
||||
o['shadowmap_cube'] = True
|
||||
o['shadows_bias'] *= 2.0
|
||||
|
@ -2684,8 +2684,8 @@ class ArmoryExporter:
|
|||
po['irradiance'] = '' # No irradiance data, fallback to default at runtime
|
||||
po['strength'] = strength
|
||||
po['blending'] = 1.0
|
||||
po['volume'] = [0, 0, 0]
|
||||
po['volume_center'] = [0, 0, 0]
|
||||
po['volume'] = [0.0, 0.0, 0.0]
|
||||
po['volume_center'] = [0.0, 0.0, 0.0]
|
||||
o['probes'].append(po)
|
||||
|
||||
# https://blender.stackexchange.com/questions/70629
|
||||
|
|
|
@ -90,11 +90,10 @@ def add_world_defs():
|
|||
|
||||
if voxelgi:
|
||||
wrd.world_defs += '_VoxelGI'
|
||||
if state.target == "native": # TODO: temp Kha compatibily fix
|
||||
assets.add_shader_external(arm.utils.get_sdk_path() + '/armory/Shaders/voxel_light/voxel_light.comp.glsl')
|
||||
if rpdat.arm_voxelgi_bounces != "1":
|
||||
assets.add_khafile_def('rp_gi_bounces={0}'.format(rpdat.arm_voxelgi_bounces))
|
||||
assets.add_shader_external(arm.utils.get_sdk_path() + '/armory/Shaders/voxel_bounce/voxel_bounce.comp.glsl')
|
||||
assets.add_shader_external(arm.utils.get_sdk_path() + '/armory/Shaders/voxel_light/voxel_light.comp.glsl')
|
||||
if rpdat.arm_voxelgi_bounces != "1":
|
||||
assets.add_khafile_def('rp_gi_bounces={0}'.format(rpdat.arm_voxelgi_bounces))
|
||||
assets.add_shader_external(arm.utils.get_sdk_path() + '/armory/Shaders/voxel_bounce/voxel_bounce.comp.glsl')
|
||||
if rpdat.arm_voxelgi_shadows:
|
||||
wrd.world_defs += '_VoxelGIDirect'
|
||||
wrd.world_defs += '_VoxelGIShadow'
|
||||
|
|
|
@ -10,10 +10,7 @@ import arm.make_state as state
|
|||
def make(context_id):
|
||||
rpdat = arm.utils.get_rp()
|
||||
if rpdat.rp_gi == 'Voxel GI':
|
||||
if state.target == "native":
|
||||
con = make_gi(context_id)
|
||||
else:
|
||||
con = make_gi_legacy(context_id)
|
||||
con = make_gi(context_id)
|
||||
else:
|
||||
con = make_ao(context_id)
|
||||
|
||||
|
@ -269,182 +266,3 @@ def make_ao(context_id):
|
|||
frag.write('imageStore(voxels, ivec3(voxelgiResolution * (voxposition * 0.5 + 0.5)), vec4(1.0));')
|
||||
|
||||
return con_voxel
|
||||
|
||||
def make_gi_legacy(context_id):
|
||||
con_voxel = mat_state.data.add_context({ 'name': context_id, 'depth_write': False, 'compare_mode': 'always', 'cull_mode': 'none', 'color_write_red': False, 'color_write_green': False, 'color_write_blue': False, 'color_write_alpha': False, 'conservative_raster': True })
|
||||
wrd = bpy.data.worlds['Arm']
|
||||
|
||||
is_shadows = not '_NoShadows' in wrd.world_defs
|
||||
|
||||
vert = con_voxel.make_vert()
|
||||
frag = con_voxel.make_frag()
|
||||
geom = con_voxel.make_geom()
|
||||
tesc = None
|
||||
tese = None
|
||||
|
||||
geom.ins = vert.outs
|
||||
frag.ins = geom.outs
|
||||
|
||||
frag.add_include('compiled.glsl')
|
||||
frag.add_include('std/math.glsl')
|
||||
frag.add_include('std/imageatomic.glsl')
|
||||
frag.write_header('#extension GL_ARB_shader_image_load_store : enable')
|
||||
|
||||
rpdat = arm.utils.get_rp()
|
||||
if rpdat.rp_voxelgi_hdr:
|
||||
frag.add_uniform('layout(rgba16) image3D voxels')
|
||||
else:
|
||||
frag.add_uniform('layout(r32ui) uimage3D voxels')
|
||||
|
||||
frag.add_uniform('vec3 lightPos', '_lampPosition')
|
||||
frag.add_uniform('vec3 lightColor', '_lampColor')
|
||||
frag.add_uniform('int lightType', '_lampType')
|
||||
frag.add_uniform('vec3 lightDir', '_lampDirection')
|
||||
|
||||
frag.write('if (abs(voxposition.z) > ' + rpdat.rp_voxelgi_resolution_z + ' || abs(voxposition.x) > 1 || abs(voxposition.y) > 1) return;')
|
||||
frag.write('vec3 wposition = voxposition * voxelgiHalfExtents;')
|
||||
if rpdat.arm_voxelgi_revoxelize and rpdat.arm_voxelgi_camera:
|
||||
frag.add_uniform('vec3 eyeSnap', '_cameraPositionSnap')
|
||||
frag.write('wposition += eyeSnap;')
|
||||
|
||||
frag.write('float visibility = 1.0;')
|
||||
frag.write('vec3 lp = lightPos - wposition;')
|
||||
frag.write('vec3 l;')
|
||||
frag.write('if (lightType == 0) l = lightDir;')
|
||||
frag.write('else { l = normalize(lp); visibility *= attenuate(distance(wposition, lightPos)); }')
|
||||
|
||||
frag.write('float dotNL = max(dot(wnormal, l), 0.0);')
|
||||
frag.write('if (dotNL == 0.0) return;')
|
||||
|
||||
if is_shadows:
|
||||
frag.add_include('std/shadows.glsl')
|
||||
frag.add_uniform('sampler2D shadowMap')
|
||||
frag.add_uniform('samplerCube shadowMapCube')
|
||||
frag.add_uniform('int lightShadow', '_lampCastShadow')
|
||||
frag.add_uniform('vec2 lightProj', '_lampPlaneProj')
|
||||
frag.add_uniform('float shadowsBias', '_lampShadowsBias')
|
||||
frag.write('if (lightShadow == 1 && lampPos.w > 0.0) {')
|
||||
frag.write(' vec3 lpos = lampPos.xyz / lampPos.w;')
|
||||
frag.write(' if (texture(shadowMap, lpos.xy).r < lpos.z - shadowsBias) visibility = 0.0;')
|
||||
frag.write('}')
|
||||
frag.write('else if (lightShadow == 2) visibility *= float(texture(shadowMapCube, -l).r + shadowsBias > lpToDepth(lp, lightProj));')
|
||||
|
||||
frag.write('vec3 basecol;')
|
||||
frag.write('float roughness;') #
|
||||
frag.write('float metallic;') #
|
||||
frag.write('float occlusion;') #
|
||||
parse_opacity = rpdat.arm_voxelgi_refraction
|
||||
if parse_opacity:
|
||||
frag.write('float opacity;')
|
||||
frag.write('float dotNV = 0.0;')
|
||||
cycles.parse(mat_state.nodes, con_voxel, vert, frag, geom, tesc, tese, parse_opacity=parse_opacity, parse_displacement=False, basecol_only=True)
|
||||
|
||||
# Voxelized particles
|
||||
particle = mat_state.material.arm_particle
|
||||
if particle == 'gpu':
|
||||
frag.write_pre = True
|
||||
frag.write('const float p_index = 0;')
|
||||
frag.write('const float p_age = 0;')
|
||||
frag.write('const float p_lifetime = 0;')
|
||||
frag.write('const vec3 p_location = vec3(0);')
|
||||
frag.write('const float p_size = 0;')
|
||||
frag.write('const vec3 p_velocity = vec3(0);')
|
||||
frag.write('const vec3 p_angular_velocity = vec3(0);')
|
||||
frag.write_pre = False
|
||||
|
||||
if not frag.contains('vec3 n ='):
|
||||
frag.write_pre = True
|
||||
frag.write('vec3 n;')
|
||||
frag.write_pre = False
|
||||
|
||||
export_mpos = frag.contains('mposition') and not frag.contains('vec3 mposition')
|
||||
if export_mpos:
|
||||
vert.add_out('vec3 mpositionGeom')
|
||||
vert.write_pre = True
|
||||
vert.write('mpositionGeom = pos;')
|
||||
vert.write_pre = False
|
||||
|
||||
vert.add_uniform('mat4 W', '_worldMatrix')
|
||||
vert.add_uniform('mat3 N', '_normalMatrix')
|
||||
|
||||
vert.add_out('vec3 voxpositionGeom')
|
||||
vert.add_out('vec3 wnormalGeom')
|
||||
|
||||
vert.add_include('compiled.glsl')
|
||||
|
||||
if con_voxel.is_elem('col'):
|
||||
vert.add_out('vec3 vcolorGeom')
|
||||
vert.write('vcolorGeom = col;')
|
||||
|
||||
if con_voxel.is_elem('tex'):
|
||||
vert.add_out('vec2 texCoordGeom')
|
||||
vert.write('texCoordGeom = tex;')
|
||||
|
||||
if rpdat.arm_voxelgi_revoxelize and rpdat.arm_voxelgi_camera:
|
||||
vert.add_uniform('vec3 eyeSnap', '_cameraPositionSnap')
|
||||
vert.write('voxpositionGeom = (vec3(W * vec4(pos, 1.0)) - eyeSnap) / voxelgiHalfExtents;')
|
||||
else:
|
||||
vert.write('voxpositionGeom = vec3(W * vec4(pos, 1.0)) / voxelgiHalfExtents;')
|
||||
vert.write('wnormalGeom = normalize(N * nor);')
|
||||
|
||||
if is_shadows:
|
||||
vert.add_out('vec4 lampPosGeom')
|
||||
vert.add_uniform('mat4 LWVP', '_biasLampWorldViewProjectionMatrix')
|
||||
vert.write('lampPosGeom = LWVP * vec4(pos, 1.0);')
|
||||
|
||||
geom.add_out('vec3 voxposition')
|
||||
geom.add_out('vec3 wnormal')
|
||||
if is_shadows:
|
||||
geom.add_out('vec4 lampPos')
|
||||
if con_voxel.is_elem('col'):
|
||||
geom.add_out('vec3 vcolor')
|
||||
if con_voxel.is_elem('tex'):
|
||||
geom.add_out('vec2 texCoord')
|
||||
if export_mpos:
|
||||
geom.add_out('vec3 mposition')
|
||||
|
||||
geom.write('vec3 p1 = voxpositionGeom[1] - voxpositionGeom[0];')
|
||||
geom.write('vec3 p2 = voxpositionGeom[2] - voxpositionGeom[0];')
|
||||
geom.write('vec3 p = abs(cross(p1, p2));')
|
||||
geom.write('for (uint i = 0; i < 3; ++i) {')
|
||||
geom.write(' voxposition = voxpositionGeom[i];')
|
||||
geom.write(' wnormal = wnormalGeom[i];')
|
||||
if is_shadows:
|
||||
geom.write(' lampPos = lampPosGeom[i];')
|
||||
if con_voxel.is_elem('col'):
|
||||
geom.write(' vcolor = vcolorGeom[i];')
|
||||
if con_voxel.is_elem('tex'):
|
||||
geom.write(' texCoord = texCoordGeom[i];')
|
||||
if export_mpos:
|
||||
geom.write(' mposition = mpositionGeom[i];')
|
||||
geom.write(' if (p.z > p.x && p.z > p.y) {')
|
||||
geom.write(' gl_Position = vec4(voxposition.x, voxposition.y, 0.0, 1.0);')
|
||||
geom.write(' }')
|
||||
geom.write(' else if (p.x > p.y && p.x > p.z) {')
|
||||
geom.write(' gl_Position = vec4(voxposition.y, voxposition.z, 0.0, 1.0);')
|
||||
geom.write(' }')
|
||||
geom.write(' else {')
|
||||
geom.write(' gl_Position = vec4(voxposition.x, voxposition.z, 0.0, 1.0);')
|
||||
geom.write(' }')
|
||||
geom.write(' EmitVertex();')
|
||||
geom.write('}')
|
||||
geom.write('EndPrimitive();')
|
||||
|
||||
if cycles.emission_found:
|
||||
frag.write('vec3 color = basecol;')
|
||||
else:
|
||||
frag.write('vec3 color = basecol * visibility * lightColor * dotNL;')
|
||||
frag.write('vec3 voxel = voxposition * 0.5 + 0.5;')
|
||||
|
||||
if rpdat.arm_voxelgi_emission:
|
||||
frag.write('color = min(color * 0.9, vec3(0.9)) + min(color / 200.0, 0.1);') # Higher range to allow emission
|
||||
|
||||
frag.write('color = clamp(color, vec3(0.0), vec3(1.0));')
|
||||
|
||||
if rpdat.rp_voxelgi_hdr:
|
||||
frag.write('imageStore(voxels, ivec3(voxelgiResolution * voxel), vec4(color, 1.0));')
|
||||
else:
|
||||
frag.write('uint val = convVec4ToRGBA8(vec4(color, 1.0) * 255);')
|
||||
frag.write('imageAtomicMax(voxels, ivec3(voxelgiResolution * voxel), val);')
|
||||
|
||||
return con_voxel
|
||||
|
|
|
@ -976,19 +976,20 @@ class ArmRenderPathPanel(bpy.types.Panel):
|
|||
layout.label('Shadows')
|
||||
box = layout.box().column()
|
||||
box.prop(rpdat, 'rp_shadowmap')
|
||||
box.enabled = rpdat.rp_shadowmap != 'Off'
|
||||
box.prop(rpdat, 'rp_shadowmap_cascades')
|
||||
col = box.column()
|
||||
col.enabled = rpdat.rp_shadowmap_cascades != '1'
|
||||
col.prop(rpdat, 'arm_shadowmap_split')
|
||||
box.prop(rpdat, 'arm_soft_shadows')
|
||||
col = box.column()
|
||||
col.enabled = rpdat.arm_soft_shadows != 'Off'
|
||||
row = col.row(align=True)
|
||||
col.enabled = rpdat.rp_shadowmap != 'Off'
|
||||
col.prop(rpdat, 'rp_shadowmap_cascades')
|
||||
col2 = col.column()
|
||||
col2.enabled = rpdat.rp_shadowmap_cascades != '1'
|
||||
col2.prop(rpdat, 'arm_shadowmap_split')
|
||||
col.prop(rpdat, 'arm_soft_shadows')
|
||||
col2 = col.column()
|
||||
col2.enabled = rpdat.arm_soft_shadows != 'Off'
|
||||
row = col2.row(align=True)
|
||||
row.alignment = 'EXPAND'
|
||||
row.prop(rpdat, 'arm_soft_shadows_penumbra')
|
||||
row.prop(rpdat, 'arm_soft_shadows_distance')
|
||||
box.prop(rpdat, 'arm_pcfsize')
|
||||
col.prop(rpdat, 'arm_pcfsize')
|
||||
|
||||
|
||||
layout.label('Global Illumination')
|
||||
|
|
|
@ -304,6 +304,13 @@ class Main {
|
|||
f.write("""
|
||||
public static function main() {
|
||||
iron.object.BoneAnimation.skinMaxBones = """ + str(rpdat.arm_skin_max_bones) + """;
|
||||
""")
|
||||
# TODO: deprecated
|
||||
if in_viewport:
|
||||
f.write("""
|
||||
untyped __js__("Krom.setPenDownCallback = function() { };");
|
||||
untyped __js__("Krom.setPenUpCallback = function() { };");
|
||||
untyped __js__("Krom.setPenMoveCallback = function() { };");
|
||||
""")
|
||||
if rpdat.rp_shadowmap_cascades != '1':
|
||||
f.write("""
|
||||
|
|
Loading…
Reference in a new issue