Compare commits
No commits in common. "main" and "main" have entirely different histories.
@ -18,7 +18,7 @@
|
|||||||
*
|
*
|
||||||
* This file is part of mbed TLS (https://tls.mbed.org)
|
* This file is part of mbed TLS (https://tls.mbed.org)
|
||||||
*/
|
*/
|
||||||
#define _GNU_SOURCE
|
|
||||||
#if !defined(MBEDTLS_CONFIG_FILE)
|
#if !defined(MBEDTLS_CONFIG_FILE)
|
||||||
#include "mbedtls/config.h"
|
#include "mbedtls/config.h"
|
||||||
#else
|
#else
|
||||||
|
@ -1,38 +1,179 @@
|
|||||||
#include <kinc/graphics4/compute.h>
|
#include <kinc/compute/compute.h>
|
||||||
#include <kinc/graphics4/texture.h>
|
#include <kinc/graphics4/texture.h>
|
||||||
|
|
||||||
#include <hl.h>
|
#include <hl.h>
|
||||||
|
|
||||||
vbyte *hl_kinc_g4_compute_create_shader(vbyte *data, int length) {
|
vbyte *hl_kinc_compute_create_shader(vbyte *data, int length) {
|
||||||
kinc_g4_compute_shader *shader = (kinc_g4_compute_shader *)malloc(sizeof(kinc_g4_compute_shader));
|
kinc_compute_shader_t *shader = (kinc_compute_shader_t *)malloc(sizeof(kinc_compute_shader_t));
|
||||||
kinc_g4_compute_shader_init(shader, data, length);
|
kinc_compute_shader_init(shader, data, length);
|
||||||
return (vbyte *)shader;
|
return (vbyte *)shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hl_kinc_g4_compute_delete_shader(vbyte *shader) {
|
void hl_kinc_compute_delete_shader(vbyte *shader) {
|
||||||
kinc_g4_compute_shader *sh = (kinc_g4_compute_shader *)shader;
|
kinc_compute_shader_t *sh = (kinc_compute_shader_t *)shader;
|
||||||
kinc_g4_compute_shader_destroy(sh);
|
kinc_compute_shader_destroy(sh);
|
||||||
free(sh);
|
free(sh);
|
||||||
}
|
}
|
||||||
|
|
||||||
vbyte *hl_kinc_g4_compute_get_constantlocation(vbyte *shader, vbyte *name) {
|
vbyte *hl_kinc_compute_get_constantlocation(vbyte *shader, vbyte *name) {
|
||||||
kinc_g4_compute_shader *sh = (kinc_g4_compute_shader *)shader;
|
kinc_compute_shader_t *sh = (kinc_compute_shader_t *)shader;
|
||||||
kinc_g4_constant_location_t *location = (kinc_g4_constant_location_t *)malloc(sizeof(kinc_g4_constant_location_t));
|
kinc_compute_constant_location_t *location = (kinc_compute_constant_location_t *)malloc(sizeof(kinc_compute_constant_location_t));
|
||||||
*location = kinc_g4_compute_shader_get_constant_location(sh, (char *)name), sizeof(kinc_g4_constant_location_t);
|
*location = kinc_compute_shader_get_constant_location(sh, (char *)name), sizeof(kinc_compute_constant_location_t);
|
||||||
return (vbyte *)location;
|
return (vbyte *)location;
|
||||||
}
|
}
|
||||||
|
|
||||||
vbyte *hl_kinc_g4_compute_get_textureunit(vbyte *shader, vbyte *name) {
|
vbyte *hl_kinc_compute_get_textureunit(vbyte *shader, vbyte *name) {
|
||||||
kinc_g4_compute_shader *sh = (kinc_g4_compute_shader *)shader;
|
kinc_compute_shader_t *sh = (kinc_compute_shader_t *)shader;
|
||||||
kinc_g4_texture_unit_t *unit = (kinc_g4_texture_unit_t *)malloc(sizeof(kinc_g4_texture_unit_t));
|
kinc_compute_texture_unit_t *unit = (kinc_compute_texture_unit_t *)malloc(sizeof(kinc_compute_texture_unit_t));
|
||||||
*unit = kinc_g4_compute_shader_get_texture_unit(sh, (char *)name), sizeof(kinc_g4_texture_unit_t);
|
*unit = kinc_compute_shader_get_texture_unit(sh, (char *)name), sizeof(kinc_compute_texture_unit_t);
|
||||||
return (vbyte *)unit;
|
return (vbyte *)unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hl_kinc_g4_set_compute_shader(vbyte *shader) {
|
void hl_kinc_compute_set_bool(vbyte *location, bool value) {
|
||||||
kinc_g4_set_compute_shader((kinc_g4_compute_shader *)shader);
|
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
|
||||||
|
kinc_compute_set_bool(*loc, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hl_kinc_g4_compute(int x, int y, int z) {
|
void hl_kinc_compute_set_int(vbyte *location, int value) {
|
||||||
kinc_g4_compute(x, y, z);
|
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
|
||||||
|
kinc_compute_set_int(*loc, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_float(vbyte *location, float value) {
|
||||||
|
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
|
||||||
|
kinc_compute_set_float(*loc, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_float2(vbyte *location, float value1, float value2) {
|
||||||
|
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
|
||||||
|
kinc_compute_set_float2(*loc, value1, value2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_float3(vbyte *location, float value1, float value2, float value3) {
|
||||||
|
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
|
||||||
|
kinc_compute_set_float3(*loc, value1, value2, value3);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_float4(vbyte *location, float value1, float value2, float value3, float value4) {
|
||||||
|
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
|
||||||
|
kinc_compute_set_float4(*loc, value1, value2, value3, value4);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_floats(vbyte *location, vbyte *values, int count) {
|
||||||
|
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
|
||||||
|
kinc_compute_set_floats(*loc, (float *)values, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_matrix(vbyte *location, float _00, float _10, float _20, float _30, float _01, float _11, float _21, float _31, float _02, float _12,
|
||||||
|
float _22, float _32, float _03, float _13, float _23, float _33) {
|
||||||
|
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
|
||||||
|
kinc_matrix4x4_t value;
|
||||||
|
kinc_matrix4x4_set(&value, 0, 0, _00);
|
||||||
|
kinc_matrix4x4_set(&value, 0, 1, _01);
|
||||||
|
kinc_matrix4x4_set(&value, 0, 2, _02);
|
||||||
|
kinc_matrix4x4_set(&value, 0, 3, _03);
|
||||||
|
kinc_matrix4x4_set(&value, 1, 0, _10);
|
||||||
|
kinc_matrix4x4_set(&value, 1, 1, _11);
|
||||||
|
kinc_matrix4x4_set(&value, 1, 2, _12);
|
||||||
|
kinc_matrix4x4_set(&value, 1, 3, _13);
|
||||||
|
kinc_matrix4x4_set(&value, 2, 0, _20);
|
||||||
|
kinc_matrix4x4_set(&value, 2, 1, _21);
|
||||||
|
kinc_matrix4x4_set(&value, 2, 2, _22);
|
||||||
|
kinc_matrix4x4_set(&value, 2, 3, _23);
|
||||||
|
kinc_matrix4x4_set(&value, 3, 0, _30);
|
||||||
|
kinc_matrix4x4_set(&value, 3, 1, _31);
|
||||||
|
kinc_matrix4x4_set(&value, 3, 2, _32);
|
||||||
|
kinc_matrix4x4_set(&value, 3, 3, _33);
|
||||||
|
kinc_compute_set_matrix4(*loc, &value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_matrix3(vbyte *location, float _00, float _10, float _20, float _01, float _11, float _21, float _02, float _12, float _22) {
|
||||||
|
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
|
||||||
|
kinc_matrix3x3_t value;
|
||||||
|
kinc_matrix3x3_set(&value, 0, 0, _00);
|
||||||
|
kinc_matrix3x3_set(&value, 0, 1, _01);
|
||||||
|
kinc_matrix3x3_set(&value, 0, 2, _02);
|
||||||
|
kinc_matrix3x3_set(&value, 1, 0, _10);
|
||||||
|
kinc_matrix3x3_set(&value, 1, 1, _11);
|
||||||
|
kinc_matrix3x3_set(&value, 1, 2, _12);
|
||||||
|
kinc_matrix3x3_set(&value, 2, 0, _20);
|
||||||
|
kinc_matrix3x3_set(&value, 2, 1, _21);
|
||||||
|
kinc_matrix3x3_set(&value, 2, 2, _22);
|
||||||
|
kinc_compute_set_matrix3(*loc, &value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_texture(vbyte *unit, vbyte *texture, int access) {
|
||||||
|
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
|
||||||
|
kinc_g4_texture_t *tex = (kinc_g4_texture_t *)texture;
|
||||||
|
kinc_compute_set_texture(*u, tex, (kinc_compute_access_t)access);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_target(vbyte *unit, vbyte *renderTarget, int access) {
|
||||||
|
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
|
||||||
|
kinc_g4_render_target_t *rt = (kinc_g4_render_target_t *)renderTarget;
|
||||||
|
kinc_compute_set_render_target(*u, rt, (kinc_compute_access_t)access);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_sampled_texture(vbyte *unit, vbyte *texture) {
|
||||||
|
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
|
||||||
|
kinc_g4_texture_t *tex = (kinc_g4_texture_t *)texture;
|
||||||
|
kinc_compute_set_sampled_texture(*u, tex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_sampled_target(vbyte *unit, vbyte *renderTarget) {
|
||||||
|
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
|
||||||
|
kinc_g4_render_target_t *rt = (kinc_g4_render_target_t *)renderTarget;
|
||||||
|
kinc_compute_set_sampled_render_target(*u, rt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_sampled_depth_target(vbyte *unit, vbyte *renderTarget) {
|
||||||
|
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
|
||||||
|
kinc_g4_render_target_t *rt = (kinc_g4_render_target_t *)renderTarget;
|
||||||
|
kinc_compute_set_sampled_depth_from_render_target(*u, rt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_sampled_cubemap_texture(vbyte *unit, vbyte *texture) {
|
||||||
|
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
|
||||||
|
kinc_g4_texture_t *tex = (kinc_g4_texture_t *)texture;
|
||||||
|
kinc_compute_set_sampled_texture(*u, tex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_sampled_cubemap_target(vbyte *unit, vbyte *renderTarget) {
|
||||||
|
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
|
||||||
|
kinc_g4_render_target_t *rt = (kinc_g4_render_target_t *)renderTarget;
|
||||||
|
kinc_compute_set_sampled_render_target(*u, rt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_sampled_cubemap_depth_target(vbyte *unit, vbyte *renderTarget) {
|
||||||
|
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
|
||||||
|
kinc_g4_render_target_t *rt = (kinc_g4_render_target_t *)renderTarget;
|
||||||
|
kinc_compute_set_sampled_depth_from_render_target(*u, rt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_texture_parameters(vbyte *unit, int uAddressing, int vAddressing, int minificationFilter, int magnificationFilter, int mipmapFilter) {
|
||||||
|
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
|
||||||
|
kinc_compute_set_texture_addressing(*u, KINC_G4_TEXTURE_DIRECTION_U, (kinc_g4_texture_addressing_t)uAddressing);
|
||||||
|
kinc_compute_set_texture_addressing(*u, KINC_G4_TEXTURE_DIRECTION_V, (kinc_g4_texture_addressing_t)vAddressing);
|
||||||
|
kinc_compute_set_texture_minification_filter(*u, (kinc_g4_texture_filter_t)minificationFilter);
|
||||||
|
kinc_compute_set_texture_magnification_filter(*u, (kinc_g4_texture_filter_t)magnificationFilter);
|
||||||
|
kinc_compute_set_texture_mipmap_filter(*u, (kinc_g4_mipmap_filter_t)mipmapFilter);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_texture3d_parameters(vbyte *unit, int uAddressing, int vAddressing, int wAddressing, int minificationFilter, int magnificationFilter,
|
||||||
|
int mipmapFilter) {
|
||||||
|
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
|
||||||
|
kinc_compute_set_texture3d_addressing(*u, KINC_G4_TEXTURE_DIRECTION_U, (kinc_g4_texture_addressing_t)uAddressing);
|
||||||
|
kinc_compute_set_texture3d_addressing(*u, KINC_G4_TEXTURE_DIRECTION_V, (kinc_g4_texture_addressing_t)vAddressing);
|
||||||
|
kinc_compute_set_texture3d_addressing(*u, KINC_G4_TEXTURE_DIRECTION_W, (kinc_g4_texture_addressing_t)wAddressing);
|
||||||
|
kinc_compute_set_texture3d_minification_filter(*u, (kinc_g4_texture_filter_t)minificationFilter);
|
||||||
|
kinc_compute_set_texture3d_magnification_filter(*u, (kinc_g4_texture_filter_t)magnificationFilter);
|
||||||
|
kinc_compute_set_texture3d_mipmap_filter(*u, (kinc_g4_mipmap_filter_t)mipmapFilter);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_set_shader(vbyte *shader) {
|
||||||
|
kinc_compute_set_shader((kinc_compute_shader_t *)shader);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hl_kinc_compute_compute(int x, int y, int z) {
|
||||||
|
kinc_compute(x, y, z);
|
||||||
}
|
}
|
||||||
|
@ -42,8 +42,8 @@ static void update(void *data) {
|
|||||||
|
|
||||||
static bool mixThreadregistered = false;
|
static bool mixThreadregistered = false;
|
||||||
|
|
||||||
static void mix(kinc_a2_buffer_t *buffer, uint32_t samples, void *userdata) {
|
static void mix(kinc_a2_buffer_t *buffer, int samples) {
|
||||||
#ifdef KINC_MULTITHREADED_AUDIO
|
#ifdef KORE_MULTITHREADED_AUDIO
|
||||||
if (!mixThreadregistered) {
|
if (!mixThreadregistered) {
|
||||||
vdynamic *ret;
|
vdynamic *ret;
|
||||||
hl_register_thread(&ret);
|
hl_register_thread(&ret);
|
||||||
@ -54,18 +54,16 @@ static void mix(kinc_a2_buffer_t *buffer, uint32_t samples, void *userdata) {
|
|||||||
|
|
||||||
audioCallCallback(samples);
|
audioCallCallback(samples);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < samples; i += 2) {
|
for (int i = 0; i < samples; ++i) {
|
||||||
float left_value = audioReadSample();
|
float value = audioReadSample();
|
||||||
float right_value = audioReadSample();
|
*(float *)&buffer->data[buffer->write_location] = value;
|
||||||
*(float *)&buffer->channels[0][buffer->write_location] = left_value;
|
buffer->write_location += 4;
|
||||||
*(float *)&buffer->channels[1][buffer->write_location] = right_value;
|
|
||||||
buffer->write_location += 1;
|
|
||||||
if (buffer->write_location >= buffer->data_size) {
|
if (buffer->write_location >= buffer->data_size) {
|
||||||
buffer->write_location = 0;
|
buffer->write_location = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KINC_MULTITHREADED_AUDIO
|
#ifdef KORE_MULTITHREADED_AUDIO
|
||||||
hl_blocking(false);
|
hl_blocking(false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -94,9 +92,9 @@ void hl_init_kore(vbyte *title, int width, int height, int samplesPerPixel, bool
|
|||||||
void hl_kinc_init_audio(vclosure *callCallback, vclosure *readSample, int *outSamplesPerSecond) {
|
void hl_kinc_init_audio(vclosure *callCallback, vclosure *readSample, int *outSamplesPerSecond) {
|
||||||
audioCallCallback = *((FN_AUDIO_CALL_CALLBACK *)(&callCallback->fun));
|
audioCallCallback = *((FN_AUDIO_CALL_CALLBACK *)(&callCallback->fun));
|
||||||
audioReadSample = *((FN_AUDIO_READ_SAMPLE *)(&readSample->fun));
|
audioReadSample = *((FN_AUDIO_READ_SAMPLE *)(&readSample->fun));
|
||||||
kinc_a2_set_callback(mix, NULL);
|
kinc_a2_set_callback(mix);
|
||||||
kinc_a2_init();
|
kinc_a2_init();
|
||||||
*outSamplesPerSecond = kinc_a2_samples_per_second();
|
*outSamplesPerSecond = kinc_a2_samples_per_second;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hl_run_kore(void) {
|
void hl_run_kore(void) {
|
||||||
|
@ -137,12 +137,12 @@ void hl_kinc_register_pen(vclosure *penDown, vclosure *penUp, vclosure *penMove)
|
|||||||
kinc_pen_set_move_callback(*((FN_PEN_MOVE *)(&penMove->fun)));
|
kinc_pen_set_move_callback(*((FN_PEN_MOVE *)(&penMove->fun)));
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (*FN_GAMEPAD_AXIS)(int, int, float, void *);
|
typedef void (*FN_GAMEPAD_AXIS)(int, int, float);
|
||||||
typedef void (*FN_GAMEPAD_BUTTON)(int, int, float, void *);
|
typedef void (*FN_GAMEPAD_BUTTON)(int, int, float);
|
||||||
|
|
||||||
void hl_kinc_register_gamepad(vclosure *gamepadAxis, vclosure *gamepadButton) {
|
void hl_kinc_register_gamepad(vclosure *gamepadAxis, vclosure *gamepadButton) {
|
||||||
kinc_gamepad_set_axis_callback(*((FN_GAMEPAD_AXIS *)(&gamepadAxis->fun)), NULL);
|
kinc_gamepad_set_axis_callback(*((FN_GAMEPAD_AXIS *)(&gamepadAxis->fun)));
|
||||||
kinc_gamepad_set_button_callback(*((FN_GAMEPAD_BUTTON *)(&gamepadButton->fun)), NULL);
|
kinc_gamepad_set_button_callback(*((FN_GAMEPAD_BUTTON *)(&gamepadButton->fun)));
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (*FN_TOUCH_START)(int, int, int);
|
typedef void (*FN_TOUCH_START)(int, int, int);
|
||||||
|
@ -26,8 +26,9 @@ class GetBoneTransformNode extends LogicNode {
|
|||||||
// Get bone in armature
|
// Get bone in armature
|
||||||
var bone = anim.getBone(boneName);
|
var bone = anim.getBone(boneName);
|
||||||
|
|
||||||
return anim.getAbsWorldMat(anim.skeletonMats, bone);
|
//return anim.getAbsWorldMat(bone);
|
||||||
//return anim.getAbsMat(bone).clone().multmat(object.transform.world);
|
return anim.getAbsMat(bone).clone().multmat(object.transform.world);
|
||||||
|
//return anim.getAbsWorldMat(bone);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
return null;
|
return null;
|
||||||
|
@ -1213,7 +1213,7 @@ class Inc {
|
|||||||
kha.compute.Compute.setSampledTexture(voxel_td4, rts.get("voxelsSDF").image);
|
kha.compute.Compute.setSampledTexture(voxel_td4, rts.get("voxelsSDF").image);
|
||||||
kha.compute.Compute.setTexture(voxel_te4, rts.get("voxels_specular").image, kha.compute.Access.Write);
|
kha.compute.Compute.setTexture(voxel_te4, rts.get("voxels_specular").image, kha.compute.Access.Write);
|
||||||
|
|
||||||
//kha.compute.Compute.setSampledTexture(voxel_tf4, rts.get("gbuffer2").image);
|
kha.compute.Compute.setSampledTexture(voxel_tf4, rts.get("gbuffer2").image);
|
||||||
|
|
||||||
var fa:Float32Array = new Float32Array(Main.voxelgiClipmapCount * 10);
|
var fa:Float32Array = new Float32Array(Main.voxelgiClipmapCount * 10);
|
||||||
for (i in 0...Main.voxelgiClipmapCount) {
|
for (i in 0...Main.voxelgiClipmapCount) {
|
||||||
|
@ -7,46 +7,48 @@ if lnx.is_reload(__name__):
|
|||||||
else:
|
else:
|
||||||
lnx.enable_reload(__name__)
|
lnx.enable_reload(__name__)
|
||||||
|
|
||||||
#lnx.keymaps = []
|
lnx.keymaps = []
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
wm = bpy.context.window_manager
|
wm = bpy.context.window_manager
|
||||||
keyconfig = wm.keyconfigs.user
|
addon_keyconfig = wm.keyconfigs.addon
|
||||||
|
|
||||||
# Keyconfigs are not available in background mode. If the keyconfig
|
# Keyconfigs are not available in background mode. If the keyconfig
|
||||||
# was not found despite running _not_ in background mode, a warning
|
# was not found despite running _not_ in background mode, a warning
|
||||||
# is printed
|
# is printed
|
||||||
if keyconfig is None:
|
if addon_keyconfig is None:
|
||||||
if not bpy.app.background:
|
if not bpy.app.background:
|
||||||
log.warn("No keyconfig path found")
|
log.warn("No keyconfig path found")
|
||||||
return
|
return
|
||||||
km = keyconfig.keymaps.get('Window')
|
|
||||||
if km is None:
|
km = addon_keyconfig.keymaps.new(name='Window', space_type='EMPTY', region_type="WINDOW")
|
||||||
log.warn("Window keymaps not available")
|
km.keymap_items.new(props_ui.LeenkxPlayButton.bl_idname, type='F5', value='PRESS')
|
||||||
return
|
km.keymap_items.new("tlm.build_lightmaps", type='F6', value='PRESS')
|
||||||
lnx_start = any(kmi.idname == props_ui.LeenkxPlayButton.bl_idname for kmi in km.keymap_items)
|
km.keymap_items.new("tlm.clean_lightmaps", type='F7', value='PRESS')
|
||||||
if not lnx_start:
|
lnx.keymaps.append(km)
|
||||||
kmw = keyconfig.keymaps.new(name='Window', space_type='EMPTY', region_type="WINDOW")
|
|
||||||
kmw.keymap_items.new(props_ui.LeenkxPlayButton.bl_idname, type='F5', value='PRESS')
|
km = addon_keyconfig.keymaps.new(name='Node Editor', space_type='NODE_EDITOR')
|
||||||
kmw.keymap_items.new('tlm.build_lightmaps', type='F6', value='PRESS')
|
|
||||||
kmw.keymap_items.new('tlm.clean_lightmaps', type='F7', value='PRESS')
|
# shift+G: Create a new node call group node
|
||||||
kmn = keyconfig.keymaps.new(name='Node Editor', space_type='NODE_EDITOR')
|
km.keymap_items.new('lnx.add_call_group_node', 'G', 'PRESS', shift=True)
|
||||||
kmn.keymap_items.new('lnx.add_call_group_node', 'G', 'PRESS', shift=True)
|
|
||||||
kmn.keymap_items.new('lnx.add_group_tree_from_selected', 'G', 'PRESS', ctrl=True)
|
# ctrl+G: make node group from selected
|
||||||
kmn.keymap_items.new('lnx.edit_group_tree', 'TAB', 'PRESS')
|
km.keymap_items.new('lnx.add_group_tree_from_selected', 'G', 'PRESS', ctrl=True)
|
||||||
kmn.keymap_items.new('node.tree_path_parent', 'TAB', 'PRESS', ctrl=True)
|
|
||||||
kmn.keymap_items.new('lnx.ungroup_group_tree', 'G', 'PRESS', alt=True)
|
# TAB: enter node groups depending on selection
|
||||||
|
km.keymap_items.new('lnx.edit_group_tree', 'TAB', 'PRESS')
|
||||||
|
|
||||||
|
# ctrl+TAB: exit node groups depending on selectio
|
||||||
|
km.keymap_items.new('node.tree_path_parent', 'TAB', 'PRESS', ctrl=True)
|
||||||
|
|
||||||
|
# alt+G: ungroup node tree
|
||||||
|
km.keymap_items.new('lnx.ungroup_group_tree', 'G', 'PRESS', alt=True)
|
||||||
|
lnx.keymaps.append(km)
|
||||||
|
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
kmw = bpy.context.window_manager.keyconfigs.user.keymaps.get('Window')
|
wm = bpy.context.window_manager
|
||||||
kmw.keymap_items.remove(kmw.keymap_items[props_ui.LeenkxPlayButton.bl_idname])
|
for km in lnx.keymaps:
|
||||||
kmw.keymap_items.remove(kmw.keymap_items['tlm.build_lightmaps'])
|
wm.keyconfigs.addon.keymaps.remove(km)
|
||||||
kmw.keymap_items.remove(kmw.keymap_items['tlm.clean_lightmaps'])
|
del lnx.keymaps[:]
|
||||||
kmn = bpy.context.window_manager.keyconfigs.user.keymaps.get('Node Editor')
|
|
||||||
kmn.keymap_items.remove(kmn.keymap_items['lnx.add_call_group_node'])
|
|
||||||
kmn.keymap_items.remove(kmn.keymap_items['lnx.add_group_tree_from_selected'])
|
|
||||||
kmn.keymap_items.remove(kmn.keymap_items['lnx.edit_group_tree'])
|
|
||||||
kmn.keymap_items.remove(kmn.keymap_items['node.tree_path_parent'])
|
|
||||||
kmn.keymap_items.remove(kmn.keymap_items['lnx.ungroup_group_tree'])
|
|
||||||
|
@ -139,9 +139,6 @@ if bpy.app.version > (4, 1, 0):
|
|||||||
subsurface_radius = c.parse_vector_input(node.inputs[9])
|
subsurface_radius = c.parse_vector_input(node.inputs[9])
|
||||||
subsurface_color = c.parse_vector_input(node.inputs[8])
|
subsurface_color = c.parse_vector_input(node.inputs[8])
|
||||||
state.out_metallic = c.parse_value_input(node.inputs[1])
|
state.out_metallic = c.parse_value_input(node.inputs[1])
|
||||||
if bpy.app.version > (4, 2, 4):
|
|
||||||
state.out_specular = c.parse_value_input(node.inputs[13])
|
|
||||||
else:
|
|
||||||
state.out_specular = c.parse_value_input(node.inputs[12])
|
state.out_specular = c.parse_value_input(node.inputs[12])
|
||||||
state.out_roughness = c.parse_value_input(node.inputs[2])
|
state.out_roughness = c.parse_value_input(node.inputs[2])
|
||||||
# Prevent black material when metal = 1.0 and roughness = 0.0
|
# Prevent black material when metal = 1.0 and roughness = 0.0
|
||||||
|
@ -686,9 +686,9 @@ def make_forward_base(con_mesh, parse_opacity=False, transluc_pass=False):
|
|||||||
if parse_opacity:
|
if parse_opacity:
|
||||||
frag.write('indirect = traceDiffuse(wposition, n, voxels, clipmaps).rgb * albedo * voxelgiDiff;')
|
frag.write('indirect = traceDiffuse(wposition, n, voxels, clipmaps).rgb * albedo * voxelgiDiff;')
|
||||||
frag.write('if (roughness < 1.0 && specular > 0.0){')
|
frag.write('if (roughness < 1.0 && specular > 0.0){')
|
||||||
frag.add_uniform('sampler2D sveloc')
|
#frag.add_uniform('sampler2D sveloc')
|
||||||
frag.write(' vec2 velocity = -textureLod(sveloc, gl_FragCoord.xy, 0.0).rg;')
|
#frag.write(' vec2 velocity = -textureLod(sveloc, gl_FragCoord.xy, 0.0).rg;')
|
||||||
frag.write(' indirect += traceSpecular(wposition, n, voxels, voxelsSDF, normalize(eye - wposition), roughness, clipmaps, gl_FragCoord.xy, velocity).rgb * specular * voxelgiRefl;}')
|
frag.write(' indirect += traceSpecular(wposition, n, voxels, voxelsSDF, normalize(eye - wposition), roughness, clipmaps, gl_FragCoord.xy).rgb * specular * voxelgiRefl;}')
|
||||||
else:
|
else:
|
||||||
frag.add_uniform("sampler2D voxels_diffuse")
|
frag.add_uniform("sampler2D voxels_diffuse")
|
||||||
frag.add_uniform("sampler2D voxels_specular")
|
frag.add_uniform("sampler2D voxels_specular")
|
||||||
@ -779,10 +779,9 @@ def make_forward_base(con_mesh, parse_opacity=False, transluc_pass=False):
|
|||||||
if '_MicroShadowing' in wrd.world_defs:
|
if '_MicroShadowing' in wrd.world_defs:
|
||||||
frag.write(', occlusion')
|
frag.write(', occlusion')
|
||||||
if '_SSRS' in wrd.world_defs:
|
if '_SSRS' in wrd.world_defs:
|
||||||
frag.add_uniform('sampler2D gbufferD', top=True)
|
|
||||||
frag.add_uniform('mat4 invVP', '_inverseViewProjectionMatrix')
|
frag.add_uniform('mat4 invVP', '_inverseViewProjectionMatrix')
|
||||||
frag.add_uniform('vec3 eye', '_cameraPosition')
|
frag.add_uniform('vec3 eye', '_cameraPosition')
|
||||||
frag.write(', gbufferD, invVP, eye')
|
frag.write(', gl_FragCoord.z, inVP, eye')
|
||||||
frag.write(');')
|
frag.write(');')
|
||||||
|
|
||||||
if '_Clusters' in wrd.world_defs:
|
if '_Clusters' in wrd.world_defs:
|
||||||
@ -795,8 +794,8 @@ def make_forward_base(con_mesh, parse_opacity=False, transluc_pass=False):
|
|||||||
|
|
||||||
if '_VoxelRefract' in wrd.world_defs and parse_opacity:
|
if '_VoxelRefract' in wrd.world_defs and parse_opacity:
|
||||||
frag.write('if (opacity < 1.0) {')
|
frag.write('if (opacity < 1.0) {')
|
||||||
frag.write(' vec2 velocity = -textureLod(sveloc, gl_FragCoord.xy, 0.0).rg;')
|
#frag.write(' vec2 velocity = -textureLod(sveloc, gl_FragCoord.xy, 0.0).rg;')
|
||||||
frag.write(' vec3 refraction = traceRefraction(wposition, n, voxels, voxelsSDF, normalize(eye - wposition), ior, roughness, clipmaps, gl_FragCoord.xy,velocity).rgb;')
|
frag.write(' vec3 refraction = traceRefraction(wposition, n, voxels, voxelsSDF, normalize(eye - wposition), ior, roughness, clipmaps, gl_FragCoord.xy).rgb;')
|
||||||
frag.write(' indirect = mix(refraction, indirect, opacity) * voxelgiRefr;')
|
frag.write(' indirect = mix(refraction, indirect, opacity) * voxelgiRefr;')
|
||||||
frag.write(' direct = mix(refraction, direct, opacity) * voxelgiRefr;')
|
frag.write(' direct = mix(refraction, direct, opacity) * voxelgiRefr;')
|
||||||
frag.write('}')
|
frag.write('}')
|
||||||
|
@ -264,7 +264,7 @@ class LnxOpenNodeHaxeSource(bpy.types.Operator):
|
|||||||
version = lnx.utils.get_last_commit()
|
version = lnx.utils.get_last_commit()
|
||||||
if version == '':
|
if version == '':
|
||||||
version = 'main'
|
version = 'main'
|
||||||
webbrowser.open(f'https://dev.leenkx.com/LeenkxTeam/LNXSDK/src/branch/{version}/leenkx/Sources/leenkx/logicnode/{name}.hx')
|
webbrowser.open(f'https://github.com/leenkx3d/leenkx/blob/{version}/leenkx/Sources/leenkx/logicnode/{name}.hx')
|
||||||
return{'FINISHED'}
|
return{'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
@ -282,7 +282,7 @@ class LnxOpenNodePythonSource(bpy.types.Operator):
|
|||||||
if version == '':
|
if version == '':
|
||||||
version = 'main'
|
version = 'main'
|
||||||
rel_path = node.__module__.replace('.', '/')
|
rel_path = node.__module__.replace('.', '/')
|
||||||
webbrowser.open(f'https://dev.leenkx.com/LeenkxTeam/LNXSDK/src/branch/{version}/leenkx/blender/{rel_path}.py')
|
webbrowser.open(f'https://github.com/leenkx3d/leenkx/blob/{version}/leenkx/blender/{rel_path}.py')
|
||||||
return{'FINISHED'}
|
return{'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ def is_gapi_gl_es() -> bool:
|
|||||||
|
|
||||||
def get_rp() -> lnx.props_renderpath.LnxRPListItem:
|
def get_rp() -> lnx.props_renderpath.LnxRPListItem:
|
||||||
wrd = bpy.data.worlds['Lnx']
|
wrd = bpy.data.worlds['Lnx']
|
||||||
if not state.is_export and wrd.lnx_play_renderpath != '' and lnx.props_renderpath.LnxRPListItem.get_by_name(wrd.lnx_play_renderpath) is not None:
|
if not state.is_export and wrd.lnx_play_renderpath != '':
|
||||||
return lnx.props_renderpath.LnxRPListItem.get_by_name(wrd.lnx_play_renderpath)
|
return lnx.props_renderpath.LnxRPListItem.get_by_name(wrd.lnx_play_renderpath)
|
||||||
else:
|
else:
|
||||||
return wrd.lnx_rplist[wrd.lnx_rplist_index]
|
return wrd.lnx_rplist[wrd.lnx_rplist_index]
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
// Keep this file so that the headers are included in the compilation
|
// Keep this file so that the headers are included in the compilation
|
||||||
#include "hl/aura/math/FFT.h"
|
#include "hl/aura/math/fft.h"
|
||||||
#include "hl/aura/types/complex_array.h"
|
#include "hl/aura/types/complex_array.h"
|
||||||
|
@ -2,27 +2,27 @@
|
|||||||
|
|
||||||
#include <hl.h>
|
#include <hl.h>
|
||||||
|
|
||||||
//#include <aura/types/_ComplexArray/HL_ComplexArrayImpl.h>
|
#include <aura/types/_ComplexArray/HL_ComplexArrayImpl.h>
|
||||||
|
|
||||||
#include "hl/aura/aurahl.h"
|
#include "hl/aura/aurahl.h"
|
||||||
#include "common_c/math/fft.h"
|
#include "common_c/math/fft.h"
|
||||||
#include "common_c/types/complex_t.h"
|
#include "common_c/types/complex_t.h"
|
||||||
|
|
||||||
//HL_PRIM void AURA_HL_FUNC(ditfft2)(aura__types___ComplexArray__HL_ComplexArrayImpl time_array, int t, aura__types___ComplexArray__HL_ComplexArrayImpl freq_array, int f, int n, int step, bool inverse) {
|
HL_PRIM void AURA_HL_FUNC(ditfft2)(aura__types___ComplexArray__HL_ComplexArrayImpl time_array, int t, aura__types___ComplexArray__HL_ComplexArrayImpl freq_array, int f, int n, int step, bool inverse) {
|
||||||
// const aura_complex_t *times = (aura_complex_t*) time_array->self;
|
const aura_complex_t *times = (aura_complex_t*) time_array->self;
|
||||||
// aura_complex_t *freqs = (aura_complex_t*) freq_array->self;
|
aura_complex_t *freqs = (aura_complex_t*) freq_array->self;
|
||||||
|
|
||||||
/// aura_ditfft2(times, t, freqs, f, n, step, inverse);
|
aura_ditfft2(times, t, freqs, f, n, step, inverse);
|
||||||
//}
|
}
|
||||||
|
|
||||||
//HL_PRIM void AURA_HL_FUNC(ditfft2_iterative)(aura__types___ComplexArray__HL_ComplexArrayImpl time_array, aura__types___ComplexArray__HL_ComplexArrayImpl freq_array, int n, bool inverse, aura__types___ComplexArray__HL_ComplexArrayImpl exp_rotation_step_table) {
|
HL_PRIM void AURA_HL_FUNC(ditfft2_iterative)(aura__types___ComplexArray__HL_ComplexArrayImpl time_array, aura__types___ComplexArray__HL_ComplexArrayImpl freq_array, int n, bool inverse, aura__types___ComplexArray__HL_ComplexArrayImpl exp_rotation_step_table) {
|
||||||
// const aura_complex_t *times = (aura_complex_t*) time_array->self;
|
const aura_complex_t *times = (aura_complex_t*) time_array->self;
|
||||||
// aura_complex_t *freqs = (aura_complex_t*) freq_array->self;
|
aura_complex_t *freqs = (aura_complex_t*) freq_array->self;
|
||||||
|
|
||||||
// const aura_complex_t *exp_lut = (aura_complex_t*) exp_rotation_step_table->self;
|
const aura_complex_t *exp_lut = (aura_complex_t*) exp_rotation_step_table->self;
|
||||||
|
|
||||||
// aura_ditfft2_iterative(times, freqs, n, inverse, exp_lut);
|
aura_ditfft2_iterative(times, freqs, n, inverse, exp_lut);
|
||||||
//}
|
}
|
||||||
|
|
||||||
//DEFINE_PRIM(_VOID, ditfft2, _BYTES _I32 _BYTES _I32 _I32 _I32 _BOOL)
|
DEFINE_PRIM(_VOID, ditfft2, _BYTES _I32 _BYTES _I32 _I32 _I32 _BOOL)
|
||||||
//DEFINE_PRIM(_VOID, ditfft2_iterative, _BYTES _BYTES _I32 _BOOL _BYTES)
|
DEFINE_PRIM(_VOID, ditfft2_iterative, _BYTES _BYTES _I32 _BOOL _BYTES)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user