basilisk-engine 0.1.42__py3-none-any.whl → 0.1.43__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of basilisk-engine might be problematic. Click here for more details.
- basilisk/__init__.py +26 -26
- basilisk/audio/sound.py +27 -27
- basilisk/bsk_assets/cube.obj +48 -48
- basilisk/collisions/broad/broad_aabb.py +102 -102
- basilisk/collisions/broad/broad_bvh.py +137 -137
- basilisk/collisions/collider.py +95 -95
- basilisk/collisions/collider_handler.py +225 -225
- basilisk/collisions/narrow/contact_manifold.py +95 -95
- basilisk/collisions/narrow/dataclasses.py +34 -34
- basilisk/collisions/narrow/deprecated.py +46 -46
- basilisk/collisions/narrow/epa.py +91 -91
- basilisk/collisions/narrow/gjk.py +66 -66
- basilisk/collisions/narrow/graham_scan.py +24 -24
- basilisk/collisions/narrow/helper.py +29 -29
- basilisk/collisions/narrow/line_intersections.py +106 -106
- basilisk/collisions/narrow/sutherland_hodgman.py +75 -75
- basilisk/config.py +53 -53
- basilisk/draw/draw.py +100 -100
- basilisk/draw/draw_handler.py +178 -178
- basilisk/draw/font_renderer.py +28 -28
- basilisk/engine.py +169 -171
- basilisk/generic/abstract_bvh.py +15 -15
- basilisk/generic/abstract_custom.py +133 -133
- basilisk/generic/collisions.py +70 -70
- basilisk/generic/input_validation.py +82 -82
- basilisk/generic/math.py +17 -17
- basilisk/generic/matrices.py +35 -35
- basilisk/generic/meshes.py +72 -72
- basilisk/generic/quat.py +142 -142
- basilisk/generic/quat_methods.py +7 -7
- basilisk/generic/raycast_result.py +26 -26
- basilisk/generic/vec3.py +143 -143
- basilisk/input_output/IO_handler.py +91 -91
- basilisk/input_output/clock.py +49 -49
- basilisk/input_output/keys.py +43 -43
- basilisk/input_output/mouse.py +90 -90
- basilisk/input_output/path.py +14 -14
- basilisk/mesh/cube.py +33 -33
- basilisk/mesh/mesh.py +233 -233
- basilisk/mesh/mesh_from_data.py +150 -150
- basilisk/mesh/model.py +271 -271
- basilisk/mesh/narrow_aabb.py +89 -89
- basilisk/mesh/narrow_bvh.py +91 -91
- basilisk/mesh/narrow_primative.py +23 -23
- basilisk/nodes/helper.py +28 -28
- basilisk/nodes/node.py +709 -709
- basilisk/nodes/node_handler.py +97 -97
- basilisk/particles/particle_handler.py +64 -64
- basilisk/particles/particle_renderer.py +93 -93
- basilisk/physics/impulse.py +112 -112
- basilisk/physics/physics_body.py +43 -43
- basilisk/physics/physics_engine.py +35 -35
- basilisk/render/batch.py +103 -103
- basilisk/render/bloom.py +118 -124
- basilisk/render/camera.py +260 -260
- basilisk/render/chunk.py +113 -108
- basilisk/render/chunk_handler.py +167 -167
- basilisk/render/frame.py +130 -128
- basilisk/render/framebuffer.py +192 -212
- basilisk/render/image.py +120 -120
- basilisk/render/image_handler.py +120 -120
- basilisk/render/light.py +96 -96
- basilisk/render/light_handler.py +58 -58
- basilisk/render/material.py +232 -232
- basilisk/render/material_handler.py +133 -133
- basilisk/render/post_process.py +180 -180
- basilisk/render/shader.py +135 -134
- basilisk/render/shader_handler.py +109 -94
- basilisk/render/sky.py +119 -121
- basilisk/scene.py +287 -288
- basilisk/shaders/batch.frag +293 -293
- basilisk/shaders/batch.vert +117 -117
- basilisk/shaders/bloom_downsample.frag +23 -42
- basilisk/shaders/bloom_upsample.frag +33 -33
- basilisk/shaders/crt.frag +34 -34
- basilisk/shaders/draw.frag +27 -27
- basilisk/shaders/draw.vert +25 -25
- basilisk/shaders/filter.frag +22 -22
- basilisk/shaders/frame.frag +13 -13
- basilisk/shaders/frame.vert +13 -13
- basilisk/shaders/frame_hdr.frag +27 -27
- basilisk/shaders/geometry.frag +10 -10
- basilisk/shaders/geometry.vert +41 -41
- basilisk/shaders/normal.frag +62 -62
- basilisk/shaders/normal.vert +96 -96
- basilisk/shaders/particle.frag +81 -81
- basilisk/shaders/particle.vert +86 -86
- basilisk/shaders/sky.frag +23 -23
- basilisk/shaders/sky.vert +13 -13
- {basilisk_engine-0.1.42.dist-info → basilisk_engine-0.1.43.dist-info}/METADATA +89 -89
- basilisk_engine-0.1.43.dist-info/RECORD +111 -0
- {basilisk_engine-0.1.42.dist-info → basilisk_engine-0.1.43.dist-info}/WHEEL +1 -1
- basilisk/input/__init__.py +0 -0
- basilisk/input/mouse.py +0 -62
- basilisk/input/path.py +0 -14
- basilisk/shaders/bloom_frame.frag +0 -25
- basilisk_engine-0.1.42.dist-info/RECORD +0 -115
- {basilisk_engine-0.1.42.dist-info → basilisk_engine-0.1.43.dist-info}/top_level.txt +0 -0
basilisk/shaders/particle.vert
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
#version 330 core
|
|
2
|
-
|
|
3
|
-
layout (location = 0) in vec3 in_position;
|
|
4
|
-
layout (location = 1) in vec2 in_uv;
|
|
5
|
-
layout (location = 2) in vec3 in_normal;
|
|
6
|
-
layout (location = 3) in vec3 in_tangent;
|
|
7
|
-
layout (location = 4) in vec3 in_bitangent;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
in vec3 in_instance_pos;
|
|
11
|
-
in float in_instance_mtl;
|
|
12
|
-
in float scale;
|
|
13
|
-
in float life;
|
|
14
|
-
|
|
15
|
-
out vec2 uv;
|
|
16
|
-
out mat3 TBN;
|
|
17
|
-
|
|
18
|
-
uniform mat4 projectionMatrix;
|
|
19
|
-
uniform mat4 viewMatrix;
|
|
20
|
-
uniform sampler2D materialsTexture;
|
|
21
|
-
|
|
22
|
-
struct Material {
|
|
23
|
-
vec3 color;
|
|
24
|
-
vec3 emissiveColor;
|
|
25
|
-
float roughness;
|
|
26
|
-
float subsurface;
|
|
27
|
-
float sheen;
|
|
28
|
-
float sheenTint;
|
|
29
|
-
float anisotropic;
|
|
30
|
-
float specular;
|
|
31
|
-
float metallicness;
|
|
32
|
-
float specularTint;
|
|
33
|
-
float clearcoat;
|
|
34
|
-
float clearcoatGloss;
|
|
35
|
-
|
|
36
|
-
int hasAlbedoMap;
|
|
37
|
-
vec2 albedoMap;
|
|
38
|
-
int hasNormalMap;
|
|
39
|
-
vec2 normalMap;
|
|
40
|
-
int hasRoughnessMap;
|
|
41
|
-
vec2 roughnessMap;
|
|
42
|
-
int hasAoMap;
|
|
43
|
-
vec2 aoMap;
|
|
44
|
-
};
|
|
45
|
-
flat out Material mtl;
|
|
46
|
-
|
|
47
|
-
// Function to get the model matrix from node position, rotation, and scale
|
|
48
|
-
mat4 getModelMatrix(vec3 pos, float scale) {
|
|
49
|
-
mat4 translation = mat4(
|
|
50
|
-
scale, 0 , 0 , 0,
|
|
51
|
-
0 , scale, 0 , 0,
|
|
52
|
-
0 , 0 , scale, 0,
|
|
53
|
-
pos.x, pos.y, pos.z, 1
|
|
54
|
-
);
|
|
55
|
-
return translation;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Function to get the TBN matrix for normal mapping
|
|
59
|
-
mat3 getTBN(mat4 modelMatrix, vec3 normal, vec3 tangent, vec3 bitangent){
|
|
60
|
-
vec3 T = normalize(vec3(modelMatrix * vec4(tangent, 0.0)));
|
|
61
|
-
vec3 B = normalize(vec3(modelMatrix * vec4(bitangent, 0.0)));
|
|
62
|
-
vec3 N = normalize(vec3(modelMatrix * vec4(normal, 0.0)));
|
|
63
|
-
return mat3(T, B, N);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
void main() {
|
|
67
|
-
// Set the model matrix
|
|
68
|
-
mat4 modelMatrix = getModelMatrix(in_instance_pos, scale * life);
|
|
69
|
-
|
|
70
|
-
// Set out variables
|
|
71
|
-
TBN = getTBN(modelMatrix, in_normal, in_tangent, in_bitangent);
|
|
72
|
-
uv = in_uv;
|
|
73
|
-
|
|
74
|
-
// Material Data
|
|
75
|
-
int mtl_size = 28;
|
|
76
|
-
int materialID = int(in_instance_mtl);
|
|
77
|
-
mtl = Material(vec3(0), vec3(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, vec2(0), 0, vec2(0), 0, vec2(0), 0, vec2(0));
|
|
78
|
-
mtl.color = vec3(texelFetch(materialsTexture, ivec2(0, 0 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 1 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 2 + materialID * mtl_size), 0).r);
|
|
79
|
-
mtl.hasAlbedoMap = int(texelFetch(materialsTexture, ivec2(0, 13 + materialID * mtl_size), 0).r);
|
|
80
|
-
mtl.albedoMap = vec2(texelFetch(materialsTexture, ivec2(0, 14 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 15 + materialID * mtl_size), 0).r);
|
|
81
|
-
mtl.hasNormalMap = int(texelFetch(materialsTexture, ivec2(0, 16 + materialID * mtl_size), 0).r);
|
|
82
|
-
mtl.normalMap = vec2(texelFetch(materialsTexture, ivec2(0, 17 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 18 + materialID * mtl_size), 0).r);
|
|
83
|
-
mtl.emissiveColor = vec3(texelFetch(materialsTexture, ivec2(0, 25 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 26 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 27 + materialID * mtl_size), 0).r);
|
|
84
|
-
|
|
85
|
-
// Send position to the frag
|
|
86
|
-
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(in_position, 1.0);
|
|
1
|
+
#version 330 core
|
|
2
|
+
|
|
3
|
+
layout (location = 0) in vec3 in_position;
|
|
4
|
+
layout (location = 1) in vec2 in_uv;
|
|
5
|
+
layout (location = 2) in vec3 in_normal;
|
|
6
|
+
layout (location = 3) in vec3 in_tangent;
|
|
7
|
+
layout (location = 4) in vec3 in_bitangent;
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
in vec3 in_instance_pos;
|
|
11
|
+
in float in_instance_mtl;
|
|
12
|
+
in float scale;
|
|
13
|
+
in float life;
|
|
14
|
+
|
|
15
|
+
out vec2 uv;
|
|
16
|
+
out mat3 TBN;
|
|
17
|
+
|
|
18
|
+
uniform mat4 projectionMatrix;
|
|
19
|
+
uniform mat4 viewMatrix;
|
|
20
|
+
uniform sampler2D materialsTexture;
|
|
21
|
+
|
|
22
|
+
struct Material {
|
|
23
|
+
vec3 color;
|
|
24
|
+
vec3 emissiveColor;
|
|
25
|
+
float roughness;
|
|
26
|
+
float subsurface;
|
|
27
|
+
float sheen;
|
|
28
|
+
float sheenTint;
|
|
29
|
+
float anisotropic;
|
|
30
|
+
float specular;
|
|
31
|
+
float metallicness;
|
|
32
|
+
float specularTint;
|
|
33
|
+
float clearcoat;
|
|
34
|
+
float clearcoatGloss;
|
|
35
|
+
|
|
36
|
+
int hasAlbedoMap;
|
|
37
|
+
vec2 albedoMap;
|
|
38
|
+
int hasNormalMap;
|
|
39
|
+
vec2 normalMap;
|
|
40
|
+
int hasRoughnessMap;
|
|
41
|
+
vec2 roughnessMap;
|
|
42
|
+
int hasAoMap;
|
|
43
|
+
vec2 aoMap;
|
|
44
|
+
};
|
|
45
|
+
flat out Material mtl;
|
|
46
|
+
|
|
47
|
+
// Function to get the model matrix from node position, rotation, and scale
|
|
48
|
+
mat4 getModelMatrix(vec3 pos, float scale) {
|
|
49
|
+
mat4 translation = mat4(
|
|
50
|
+
scale, 0 , 0 , 0,
|
|
51
|
+
0 , scale, 0 , 0,
|
|
52
|
+
0 , 0 , scale, 0,
|
|
53
|
+
pos.x, pos.y, pos.z, 1
|
|
54
|
+
);
|
|
55
|
+
return translation;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Function to get the TBN matrix for normal mapping
|
|
59
|
+
mat3 getTBN(mat4 modelMatrix, vec3 normal, vec3 tangent, vec3 bitangent){
|
|
60
|
+
vec3 T = normalize(vec3(modelMatrix * vec4(tangent, 0.0)));
|
|
61
|
+
vec3 B = normalize(vec3(modelMatrix * vec4(bitangent, 0.0)));
|
|
62
|
+
vec3 N = normalize(vec3(modelMatrix * vec4(normal, 0.0)));
|
|
63
|
+
return mat3(T, B, N);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
void main() {
|
|
67
|
+
// Set the model matrix
|
|
68
|
+
mat4 modelMatrix = getModelMatrix(in_instance_pos, scale * life);
|
|
69
|
+
|
|
70
|
+
// Set out variables
|
|
71
|
+
TBN = getTBN(modelMatrix, in_normal, in_tangent, in_bitangent);
|
|
72
|
+
uv = in_uv;
|
|
73
|
+
|
|
74
|
+
// Material Data
|
|
75
|
+
int mtl_size = 28;
|
|
76
|
+
int materialID = int(in_instance_mtl);
|
|
77
|
+
mtl = Material(vec3(0), vec3(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, vec2(0), 0, vec2(0), 0, vec2(0), 0, vec2(0));
|
|
78
|
+
mtl.color = vec3(texelFetch(materialsTexture, ivec2(0, 0 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 1 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 2 + materialID * mtl_size), 0).r);
|
|
79
|
+
mtl.hasAlbedoMap = int(texelFetch(materialsTexture, ivec2(0, 13 + materialID * mtl_size), 0).r);
|
|
80
|
+
mtl.albedoMap = vec2(texelFetch(materialsTexture, ivec2(0, 14 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 15 + materialID * mtl_size), 0).r);
|
|
81
|
+
mtl.hasNormalMap = int(texelFetch(materialsTexture, ivec2(0, 16 + materialID * mtl_size), 0).r);
|
|
82
|
+
mtl.normalMap = vec2(texelFetch(materialsTexture, ivec2(0, 17 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 18 + materialID * mtl_size), 0).r);
|
|
83
|
+
mtl.emissiveColor = vec3(texelFetch(materialsTexture, ivec2(0, 25 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 26 + materialID * mtl_size), 0).r, texelFetch(materialsTexture, ivec2(0, 27 + materialID * mtl_size), 0).r);
|
|
84
|
+
|
|
85
|
+
// Send position to the frag
|
|
86
|
+
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(in_position, 1.0);
|
|
87
87
|
}
|
basilisk/shaders/sky.frag
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
#version 330 core
|
|
2
|
-
|
|
3
|
-
layout (location = 0) out vec4 fragColor;
|
|
4
|
-
layout (location = 1) out vec4 bloomColor;
|
|
5
|
-
|
|
6
|
-
in vec3 texCubeCoords;
|
|
7
|
-
|
|
8
|
-
uniform samplerCube skyboxTexture;
|
|
9
|
-
|
|
10
|
-
void main() {
|
|
11
|
-
const float gamma = 2.2;
|
|
12
|
-
const float exposure = 1.0;
|
|
13
|
-
vec3 ldrColor = texture(skyboxTexture, texCubeCoords).rgb;
|
|
14
|
-
|
|
15
|
-
// Inverse gamma correction (sRGB to linear)
|
|
16
|
-
ldrColor = pow(ldrColor, vec3(gamma));
|
|
17
|
-
|
|
18
|
-
// Apply exposure (pseudo-HDR)
|
|
19
|
-
vec3 hdrColor = ldrColor * exposure;
|
|
20
|
-
|
|
21
|
-
fragColor = vec4(hdrColor, 1.0);
|
|
22
|
-
|
|
23
|
-
bloomColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
1
|
+
#version 330 core
|
|
2
|
+
|
|
3
|
+
layout (location = 0) out vec4 fragColor;
|
|
4
|
+
layout (location = 1) out vec4 bloomColor;
|
|
5
|
+
|
|
6
|
+
in vec3 texCubeCoords;
|
|
7
|
+
|
|
8
|
+
uniform samplerCube skyboxTexture;
|
|
9
|
+
|
|
10
|
+
void main() {
|
|
11
|
+
const float gamma = 2.2;
|
|
12
|
+
const float exposure = 1.0;
|
|
13
|
+
vec3 ldrColor = texture(skyboxTexture, texCubeCoords).rgb;
|
|
14
|
+
|
|
15
|
+
// Inverse gamma correction (sRGB to linear)
|
|
16
|
+
ldrColor = pow(ldrColor, vec3(gamma));
|
|
17
|
+
|
|
18
|
+
// Apply exposure (pseudo-HDR)
|
|
19
|
+
vec3 hdrColor = ldrColor * exposure;
|
|
20
|
+
|
|
21
|
+
fragColor = vec4(hdrColor, 1.0);
|
|
22
|
+
|
|
23
|
+
bloomColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
24
24
|
}
|
basilisk/shaders/sky.vert
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
#version 330 core
|
|
2
|
-
layout (location = 0) in vec3 in_position;
|
|
3
|
-
|
|
4
|
-
out vec3 texCubeCoords;
|
|
5
|
-
|
|
6
|
-
uniform mat4 projectionMatrix;
|
|
7
|
-
uniform mat4 viewMatrix;
|
|
8
|
-
|
|
9
|
-
void main() {
|
|
10
|
-
texCubeCoords = in_position;
|
|
11
|
-
vec4 pos = projectionMatrix * mat4(mat3(viewMatrix)) * vec4(in_position, 1.0);
|
|
12
|
-
gl_Position = pos.xyww;
|
|
13
|
-
gl_Position.z -= 0.0001;
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (location = 0) in vec3 in_position;
|
|
3
|
+
|
|
4
|
+
out vec3 texCubeCoords;
|
|
5
|
+
|
|
6
|
+
uniform mat4 projectionMatrix;
|
|
7
|
+
uniform mat4 viewMatrix;
|
|
8
|
+
|
|
9
|
+
void main() {
|
|
10
|
+
texCubeCoords = in_position;
|
|
11
|
+
vec4 pos = projectionMatrix * mat4(mat3(viewMatrix)) * vec4(in_position, 1.0);
|
|
12
|
+
gl_Position = pos.xyww;
|
|
13
|
+
gl_Position.z -= 0.0001;
|
|
14
14
|
}
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
Metadata-Version: 2.2
|
|
2
|
-
Name: basilisk-engine
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: Python 3D Framework
|
|
5
|
-
Home-page: https://basilisk-website.vercel.app/
|
|
6
|
-
Author: Name
|
|
7
|
-
Author-email: basiliskengine@gmail.com
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
Requires-Dist: numpy
|
|
10
|
-
Requires-Dist: pillow
|
|
11
|
-
Requires-Dist: pygame-ce
|
|
12
|
-
Requires-Dist: moderngl
|
|
13
|
-
Requires-Dist: PyGLM
|
|
14
|
-
Requires-Dist: numba
|
|
15
|
-
Dynamic: author
|
|
16
|
-
Dynamic: author-email
|
|
17
|
-
Dynamic: description
|
|
18
|
-
Dynamic: description-content-type
|
|
19
|
-
Dynamic: home-page
|
|
20
|
-
Dynamic: requires-dist
|
|
21
|
-
Dynamic: summary
|
|
22
|
-
|
|
23
|
-
# Basilisk Engine
|
|
24
|
-

|
|
25
|
-
Basilisk is a 3D engine package for python that can create visualizations, simulations, and video games from the comfort and ease of Python. Basilisk is designed for quick and effortless development with a powerful backend engine that supports larger scaled projects. The engine automatically handles all graphics and physics for you, with the option to inject your own functionality if desired.
|
|
26
|
-
|
|
27
|
-
<p align="center">
|
|
28
|
-
<img src="images/mud.png" alt="mud" width="400"/>
|
|
29
|
-
<img src="images/foil.png" alt="foil" width="400"/>
|
|
30
|
-
<img src="images/cloth.png" alt="mud" width="400"/>
|
|
31
|
-
<img src="images/floor.png" alt="mud" width="400"/>
|
|
32
|
-
</p>
|
|
33
|
-
|
|
34
|
-
# Quick Start
|
|
35
|
-
## Installation
|
|
36
|
-
To start, you will need to install Basilisk engine. To do so, simply run the following command from the terminal:
|
|
37
|
-
|
|
38
|
-
```cmd
|
|
39
|
-
pip install basilisk-engine
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Now you will be able to import the package with `import basilisk`. Since Basilisk is fully open source, you also have the option to download the code from the [github](https://github.com/Loffelt/BasiliskEngine) if you prefer.
|
|
43
|
-
|
|
44
|
-
## First Program
|
|
45
|
-
Every Basilisk prorgam has an [Engine]() that handles the high level functionality of Basilisk. Additionally, you will want a [Scene]() which will hold the application's objects.
|
|
46
|
-
|
|
47
|
-
```py
|
|
48
|
-
# Import basilisk into the project. We use bsk as convention
|
|
49
|
-
import basilisk as bsk
|
|
50
|
-
|
|
51
|
-
# Initialize objects for the engine and the scene
|
|
52
|
-
engine = bsk.Engine()
|
|
53
|
-
scene = bsk.Scene(engine)
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Here we will introduce an important paradigm of Basilisk's design that will reoccur throughout this guide. Most things used in Basilisk are objects, such as the engine and the scene. You can use these objects wherever and whenever you want. In this instance, we pass the engine to the scene, so that Basilisk knows the scene is part of the engine. Now, we will set up the game loop. We use a while loop by convention.
|
|
57
|
-
|
|
58
|
-
```py
|
|
59
|
-
while engine.running: # Check that the engine is still running
|
|
60
|
-
scene.update() # Update the scene and render to temporary frame
|
|
61
|
-
engine.update() # Update the engine and render to the screen
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
The `engine.running` attribute is just a boolean flag that tells the user if the engine is running still and has not been stoped for any reason. The `scene.update()` function will render the scene and handle physics/object updates for the tick. The `engine.update()` function will tell the engine to handle all frame rendering and inputs.
|
|
65
|
-
|
|
66
|
-
With just these six lines of code, you can now run the python file, and you should see something like this. Note that you can free your mouse by pressing escape (this behavior can be changed if desired see input section in [Engine]() reference page):
|
|
67
|
-
|
|
68
|
-
<div align="center">
|
|
69
|
-
<img src="docs/images/0_boilerplate.png" alt="mud" width="400"/>
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
Congratulations you have finished your first Basilisk program!
|
|
73
|
-
|
|
74
|
-
## Full Code
|
|
75
|
-
For clarity, here is the full code used in this tutorial.
|
|
76
|
-
|
|
77
|
-
```py
|
|
78
|
-
import basilisk as bsk
|
|
79
|
-
|
|
80
|
-
engine = bsk.Engine()
|
|
81
|
-
scene = bsk.Scene(engine)
|
|
82
|
-
|
|
83
|
-
while engine.running:
|
|
84
|
-
scene.update()
|
|
85
|
-
engine.update()
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Learn more at the [Basilisk Engine Website](https://basilisk-website.vercel.app)
|
|
89
|
-
Webpage still under development.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: basilisk-engine
|
|
3
|
+
Version: 0.1.43
|
|
4
|
+
Summary: Python 3D Framework
|
|
5
|
+
Home-page: https://basilisk-website.vercel.app/
|
|
6
|
+
Author: Name
|
|
7
|
+
Author-email: basiliskengine@gmail.com
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: numpy
|
|
10
|
+
Requires-Dist: pillow
|
|
11
|
+
Requires-Dist: pygame-ce
|
|
12
|
+
Requires-Dist: moderngl
|
|
13
|
+
Requires-Dist: PyGLM
|
|
14
|
+
Requires-Dist: numba
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: author-email
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: home-page
|
|
20
|
+
Dynamic: requires-dist
|
|
21
|
+
Dynamic: summary
|
|
22
|
+
|
|
23
|
+
# Basilisk Engine
|
|
24
|
+

|
|
25
|
+
Basilisk is a 3D engine package for python that can create visualizations, simulations, and video games from the comfort and ease of Python. Basilisk is designed for quick and effortless development with a powerful backend engine that supports larger scaled projects. The engine automatically handles all graphics and physics for you, with the option to inject your own functionality if desired.
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="images/mud.png" alt="mud" width="400"/>
|
|
29
|
+
<img src="images/foil.png" alt="foil" width="400"/>
|
|
30
|
+
<img src="images/cloth.png" alt="mud" width="400"/>
|
|
31
|
+
<img src="images/floor.png" alt="mud" width="400"/>
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
# Quick Start
|
|
35
|
+
## Installation
|
|
36
|
+
To start, you will need to install Basilisk engine. To do so, simply run the following command from the terminal:
|
|
37
|
+
|
|
38
|
+
```cmd
|
|
39
|
+
pip install basilisk-engine
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Now you will be able to import the package with `import basilisk`. Since Basilisk is fully open source, you also have the option to download the code from the [github](https://github.com/Loffelt/BasiliskEngine) if you prefer.
|
|
43
|
+
|
|
44
|
+
## First Program
|
|
45
|
+
Every Basilisk prorgam has an [Engine]() that handles the high level functionality of Basilisk. Additionally, you will want a [Scene]() which will hold the application's objects.
|
|
46
|
+
|
|
47
|
+
```py
|
|
48
|
+
# Import basilisk into the project. We use bsk as convention
|
|
49
|
+
import basilisk as bsk
|
|
50
|
+
|
|
51
|
+
# Initialize objects for the engine and the scene
|
|
52
|
+
engine = bsk.Engine()
|
|
53
|
+
scene = bsk.Scene(engine)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Here we will introduce an important paradigm of Basilisk's design that will reoccur throughout this guide. Most things used in Basilisk are objects, such as the engine and the scene. You can use these objects wherever and whenever you want. In this instance, we pass the engine to the scene, so that Basilisk knows the scene is part of the engine. Now, we will set up the game loop. We use a while loop by convention.
|
|
57
|
+
|
|
58
|
+
```py
|
|
59
|
+
while engine.running: # Check that the engine is still running
|
|
60
|
+
scene.update() # Update the scene and render to temporary frame
|
|
61
|
+
engine.update() # Update the engine and render to the screen
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The `engine.running` attribute is just a boolean flag that tells the user if the engine is running still and has not been stoped for any reason. The `scene.update()` function will render the scene and handle physics/object updates for the tick. The `engine.update()` function will tell the engine to handle all frame rendering and inputs.
|
|
65
|
+
|
|
66
|
+
With just these six lines of code, you can now run the python file, and you should see something like this. Note that you can free your mouse by pressing escape (this behavior can be changed if desired see input section in [Engine]() reference page):
|
|
67
|
+
|
|
68
|
+
<div align="center">
|
|
69
|
+
<img src="docs/images/0_boilerplate.png" alt="mud" width="400"/>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
Congratulations you have finished your first Basilisk program!
|
|
73
|
+
|
|
74
|
+
## Full Code
|
|
75
|
+
For clarity, here is the full code used in this tutorial.
|
|
76
|
+
|
|
77
|
+
```py
|
|
78
|
+
import basilisk as bsk
|
|
79
|
+
|
|
80
|
+
engine = bsk.Engine()
|
|
81
|
+
scene = bsk.Scene(engine)
|
|
82
|
+
|
|
83
|
+
while engine.running:
|
|
84
|
+
scene.update()
|
|
85
|
+
engine.update()
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Learn more at the [Basilisk Engine Website](https://basilisk-website.vercel.app)
|
|
89
|
+
Webpage still under development.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
basilisk/__init__.py,sha256=iek4GeDKFC1oFX6JHCzyB-6F1iqHY9fiQo6S-qiotsk,1160
|
|
2
|
+
basilisk/config.py,sha256=czvjhMD2QVOGfxrdVfxI-jOex54dRwwwYzBiACYuZ0s,1765
|
|
3
|
+
basilisk/engine.py,sha256=QnTcT6o0CAYpcVSqh0kYO2Pd4GuZ5JZxNJmELBY8wcY,6171
|
|
4
|
+
basilisk/scene.py,sha256=noORu3dUPuNCeU90A3FmrVvF9g7t55Pw8S1Cvk2YWFk,12510
|
|
5
|
+
basilisk/audio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
basilisk/audio/sound.py,sha256=BjqaPv_07iD_-NDRy1cc0TS4PJzAnQc4hfsW9ntNjGQ,719
|
|
7
|
+
basilisk/bsk_assets/Roboto-Regular.ttf,sha256=kqYnZjMRQMpbyLulIChCLSdgYa1XF8GsUIoRi2Gcauw,168260
|
|
8
|
+
basilisk/bsk_assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
basilisk/bsk_assets/basilisk.png,sha256=1xePD8qDycxlRQ7hjEmfuw900BRykhRyumJePi6hxi8,21299
|
|
10
|
+
basilisk/bsk_assets/cube.obj,sha256=rLm2nNcfj1zPZUx-VSF5CxqnToteHjzXQNxfRNq5iKU,1189
|
|
11
|
+
basilisk/bsk_assets/skybox.png,sha256=0C9MvWUwNzewyiMtWLKrZJzAcLC1Ce72T3-Lq4hJZu0,1206153
|
|
12
|
+
basilisk/collisions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
basilisk/collisions/collider.py,sha256=JQn1C1Iuj0zMp3_KLyckWW9BcPfRqBRbCE6cMpAGUNM,4584
|
|
14
|
+
basilisk/collisions/collider_handler.py,sha256=CsrsCwUgLUHUa_oWQMosgchnkIS6UAvurYGRcrl_mHM,11456
|
|
15
|
+
basilisk/collisions/broad/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
basilisk/collisions/broad/broad_aabb.py,sha256=cyBCFFFkMY0yNDqBUY0HZ711m3QSSzoW2Ao9f8cFshE,4708
|
|
17
|
+
basilisk/collisions/broad/broad_bvh.py,sha256=M7sMYRzxAwjIu_nkYKrL8HW3YxzBvfrSN1qKClNY568,5127
|
|
18
|
+
basilisk/collisions/narrow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
+
basilisk/collisions/narrow/contact_manifold.py,sha256=mHi6fhrVJcBE37aU4u08hb0OmeaTtIZE_TnnMSdngYA,4893
|
|
20
|
+
basilisk/collisions/narrow/dataclasses.py,sha256=aZVL6WEfapdhSp8WFhydTPf92Rb8fPvCEJB6TZMyTHM,950
|
|
21
|
+
basilisk/collisions/narrow/deprecated.py,sha256=yQh6VOoVcwYENU4TThk_pXPSmwT3EfxMKILVR43sEDI,2751
|
|
22
|
+
basilisk/collisions/narrow/epa.py,sha256=XY-SeBuYMlbI-OB5_3NBkIPSrK6wL20He8FmtaVqacY,4708
|
|
23
|
+
basilisk/collisions/narrow/gjk.py,sha256=2EfQZ9GCatbf5KFLCfTKTWpa4kQcRXCNnbdqSAWj-d0,3348
|
|
24
|
+
basilisk/collisions/narrow/graham_scan.py,sha256=4cpsK2qbvLPw09LGXZp779Z536B-bpQciF-atZ4ngEI,862
|
|
25
|
+
basilisk/collisions/narrow/helper.py,sha256=aUdLdHkbAimnMnh_TWIanCTOJi2ZTY-cXLMhzqZudsQ,1261
|
|
26
|
+
basilisk/collisions/narrow/line_intersections.py,sha256=CGtttZ6n51u4l8JtQXzkClgZ_uvgx9IyrrGqli6JDbI,4629
|
|
27
|
+
basilisk/collisions/narrow/sutherland_hodgman.py,sha256=SUjSU5y7AuzIDiljMcTXxlGuFHT5IwtrOJ_k5HS1S2Y,3140
|
|
28
|
+
basilisk/draw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
+
basilisk/draw/draw.py,sha256=j6vMAww5RqU_4VM4UcgxXl7FASBPbxy1Dqr-2eLx2pY,3620
|
|
30
|
+
basilisk/draw/draw_handler.py,sha256=aoN0p2lQWUCRtn5M7dR2zwPqe03d0_Sm75BV64BNcSM,6283
|
|
31
|
+
basilisk/draw/font_renderer.py,sha256=gyI59fW3DUswIcSg5VJLLcJti3OLTMdXNQrYJaw18dE,1092
|
|
32
|
+
basilisk/generic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
+
basilisk/generic/abstract_bvh.py,sha256=iQ6HjcI8Msw34dZ3YuDAhWSqEc4NTBHAaGqAZZAoLL8,383
|
|
34
|
+
basilisk/generic/abstract_custom.py,sha256=1kDrMDfXFujBDGr3sbOzeVV5OKyLcpw5WmnfXVWFCqY,4539
|
|
35
|
+
basilisk/generic/collisions.py,sha256=qQ3Q-pJ-bchwfjCkLZXEqBO0YVu33CQQwbpfB9vkjco,2632
|
|
36
|
+
basilisk/generic/input_validation.py,sha256=YePW3qR3d4kdgUptya6n8gKMgvytZPM--zVaFv_hppk,4326
|
|
37
|
+
basilisk/generic/math.py,sha256=SmICsI0ZMF2G90z_utStL6ggp9RWqVcELMM9hrAptuw,694
|
|
38
|
+
basilisk/generic/matrices.py,sha256=QTKwujcIHzakil4MgbYJLObg7WqP-J9OesrqoSMZ5NU,1323
|
|
39
|
+
basilisk/generic/meshes.py,sha256=0Zq5EkWEtqz-2V-kEQt-R3JZvUS5RTqflih8Mj9vL4o,2639
|
|
40
|
+
basilisk/generic/quat.py,sha256=4uVMo_ZyB9a0yX89JCKrLUb7pqu2DbLn1cNByGb9Z-k,5244
|
|
41
|
+
basilisk/generic/quat_methods.py,sha256=FFqS2Iy1OLH6oJf1elhH9RbWiE_KMXe5eO95ayrEhbc,241
|
|
42
|
+
basilisk/generic/raycast_result.py,sha256=S0eRDWk8Qi0AW1xkqp9PzFJRUD8iJ365SOaldWi9xU4,809
|
|
43
|
+
basilisk/generic/vec3.py,sha256=n_OAVVFtzH-ctqU8Pqhs2426MQ0WOgBbq2Lfo3Nt498,5280
|
|
44
|
+
basilisk/input_output/IO_handler.py,sha256=jlBQTu7TlDICKcauJrTDtGrdY_U4yJUYSFu2WFGh6ys,2913
|
|
45
|
+
basilisk/input_output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
|
+
basilisk/input_output/clock.py,sha256=cFnWDBItD5pWw3Gu1xld771hYpYR_G6Z53DvJiZj5jg,1511
|
|
47
|
+
basilisk/input_output/keys.py,sha256=hTZqrR4EVLOXLq093yBBqBbpJJoasQV85BuBG5eW5aw,1411
|
|
48
|
+
basilisk/input_output/mouse.py,sha256=sTqr0Uh7Sy7bQyLvaObpDzERSeDaXN2_LdBgeMkf164,3066
|
|
49
|
+
basilisk/input_output/path.py,sha256=GiO1OS1UGujnl3KdIB7fGzI5BgIg7RHyI8LxsGWskcs,455
|
|
50
|
+
basilisk/mesh/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
|
+
basilisk/mesh/cube.py,sha256=UAwjEmaoWfUdtSKjxATU6vUbksDYj7_bBIr1k1xDsYc,1077
|
|
52
|
+
basilisk/mesh/mesh.py,sha256=0Mxd7Dj-qCAHW-gzaKlqF0FByoHtGzuu-EmiLRy024s,9990
|
|
53
|
+
basilisk/mesh/mesh_from_data.py,sha256=QiWFFWUVbv9yhMkfo3yYpvK2a9gLUbSPYocdEQVgz-4,5138
|
|
54
|
+
basilisk/mesh/model.py,sha256=uVnYm_XYSoZslNWmOego59Ku-gqKxZHpta_dHi65X1s,11993
|
|
55
|
+
basilisk/mesh/narrow_aabb.py,sha256=0lc06JgdfhUbzxUnCz4dcbEYSB3xjAf7DY7ec2096is,3868
|
|
56
|
+
basilisk/mesh/narrow_bvh.py,sha256=jLQhmUNi6mFyU2wVwB_SOf4PIaOAygBTtcnQIyaMOGg,4351
|
|
57
|
+
basilisk/mesh/narrow_primative.py,sha256=vWpIeo8I9le-EAvcr9rFUQlbl9mi6eYroqCSMK-m9eY,953
|
|
58
|
+
basilisk/nodes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
|
+
basilisk/nodes/helper.py,sha256=VdlGuEaMtLa992_8yNOB-QIgz4Izr5wNMSm8H6KftKE,2097
|
|
60
|
+
basilisk/nodes/node.py,sha256=tk4xV4Mqhm-BnEBYmau3MTGYHhjXqFk0VkRJCN1C3Sk,33886
|
|
61
|
+
basilisk/nodes/node_handler.py,sha256=V8OYMuI7WkULuoprE8_mN2bCrkml_no8fJN2sNcXPGQ,4203
|
|
62
|
+
basilisk/particles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
|
+
basilisk/particles/particle_handler.py,sha256=g35CwFRvYVT5mxssEKaj9PgkCErbfP7kDcsu4e_VyFI,2991
|
|
64
|
+
basilisk/particles/particle_renderer.py,sha256=GPC7txDpCP5cuRsrBvg-3xWNgof7vztfWuHwTtxzOfU,3794
|
|
65
|
+
basilisk/physics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
|
+
basilisk/physics/impulse.py,sha256=zv6MoGTSlu8qVbsbe2QxERGeyQZYbtzR_WVSqVLsmhw,5873
|
|
67
|
+
basilisk/physics/physics_body.py,sha256=_mi-AVMgQqUsC3bQIca5tgk2xWXTIUw0D_uC4DcQqqs,1508
|
|
68
|
+
basilisk/physics/physics_engine.py,sha256=IPMshr4j5TII5JdcRqiULc6BfkeCLPxdICKqQeZGAtY,1735
|
|
69
|
+
basilisk/render/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
|
+
basilisk/render/batch.py,sha256=wLRhk7neeTCQ_c1WrL2zFc8m3sNTF6whnJC1SPoAj9I,3499
|
|
71
|
+
basilisk/render/bloom.py,sha256=xKbGYjcdYZiphFq1ZHqd6bCYNIbZrQh4me9DT1OUXVc,4302
|
|
72
|
+
basilisk/render/camera.py,sha256=Bzyqp1ESNqjTR03hZIhil7pU1In5JDz-7sCj1Pter-M,9909
|
|
73
|
+
basilisk/render/chunk.py,sha256=49qZKV4Nwr1iK83T5fjiuGQEl_NheqCr1qpgxVcHmGU,3034
|
|
74
|
+
basilisk/render/chunk_handler.py,sha256=zJPYv3vw6_mtYQ0fW46j87dGrZENMBcRuHFzFOxqY-Q,6572
|
|
75
|
+
basilisk/render/frame.py,sha256=ng0rTyROfhJ09raSnt_hmYdaqn1eGo_bM9Qp9Y9BSdA,4258
|
|
76
|
+
basilisk/render/framebuffer.py,sha256=jvqa9-wVgY8sxzF24ALdz7T5717oXlLhEP4kB8KKS34,7063
|
|
77
|
+
basilisk/render/image.py,sha256=r-khPFJkZS8D0n_I4HeKk72lzbHeEYEM0Cp-KuR22Jk,4104
|
|
78
|
+
basilisk/render/image_handler.py,sha256=kYzO23Ke9EWaTgQlJGeUsi4gmrSDrByI55tgg3OuNW8,4303
|
|
79
|
+
basilisk/render/light.py,sha256=hFqODv9iK4GEDZeDyBHxOWwwd4v8Pm089_xoScBMjVY,3879
|
|
80
|
+
basilisk/render/light_handler.py,sha256=baJ1p0ob_5OK2Dyd5zZYcldAGWUyVlF21dp_Yfopyd8,2162
|
|
81
|
+
basilisk/render/material.py,sha256=umGdE-wI8CEXTArPzZc5rmyHKendsQWkOkpb0l5B6m8,10304
|
|
82
|
+
basilisk/render/material_handler.py,sha256=dKw5k6SVf4EGvPR-PobObTl5Kid-YK05vl8QoL3pAJA,4194
|
|
83
|
+
basilisk/render/post_process.py,sha256=MZfry8c2CaHzW4QnM9o1jm3RXTyTac12aIEd2D6u_qc,6699
|
|
84
|
+
basilisk/render/shader.py,sha256=o8NGkWfwwM3_DqxIwXThkMsyxsHgmW9crXWr54p0Tnc,5005
|
|
85
|
+
basilisk/render/shader_handler.py,sha256=WOY-m0cBPztTB--pleqKfQlYGaDUlar0GseN-872MJA,3369
|
|
86
|
+
basilisk/render/sky.py,sha256=w1_K_H7wft-8-mCWJNRZF-rPK_0qM5hC3Q3FN4kj2s4,4768
|
|
87
|
+
basilisk/render/tempCodeRunnerFile.py,sha256=ep1eVZzUd30SDCNE5l3OJsqp2fW2LEXrjYGW31AMWgw,10
|
|
88
|
+
basilisk/shaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
|
+
basilisk/shaders/batch.frag,sha256=kM5mMy2s9XrUMoivPaRirda_HAOgGzXCBhFIVlWStG0,9917
|
|
90
|
+
basilisk/shaders/batch.vert,sha256=xh-9DWRVi5ySMl23vqSEueGDdz1K_2RT9CKMtlY-xmA,5672
|
|
91
|
+
basilisk/shaders/bloom_downsample.frag,sha256=dkgC6_ZkFJPYBLjgQLd9vFLplVvMO0sA_E9ZcgGt0I8,708
|
|
92
|
+
basilisk/shaders/bloom_upsample.frag,sha256=0xKkuTSfAxDco5NFqPOt9BtQ-ITGyQ3S0xH2szww19A,1189
|
|
93
|
+
basilisk/shaders/crt.frag,sha256=3bp1alrgSauvd-PXzsCx7q9VfspIlQ5gNccrs6meir4,1077
|
|
94
|
+
basilisk/shaders/draw.frag,sha256=Bdt5PfFxNmsHQ3X48MO6Adc3Kgk0BPX-VHOyvMJ1OTE,632
|
|
95
|
+
basilisk/shaders/draw.vert,sha256=rMtpZFcF3Batup8xgAoJuxJhZ03c8DZ6uu7G5BdJe-A,621
|
|
96
|
+
basilisk/shaders/filter.frag,sha256=m_egR4yiFRmIHGwCCfpcdvGXQi1w1Ago_iABlbnX80c,584
|
|
97
|
+
basilisk/shaders/frame.frag,sha256=i3lvdKYyRKsDXV51ZyjyLrYKd5_zaRtBJXDjwuIvMBc,207
|
|
98
|
+
basilisk/shaders/frame.vert,sha256=KPB-Q3-Rix9-JxSj5tBHbZOu7QCdFgCzHwiZKEYIbFc,227
|
|
99
|
+
basilisk/shaders/frame_hdr.frag,sha256=WfoNWu_s5JxsX_-X-KUJsonCWQ6h7XIn73eRca8TouM,612
|
|
100
|
+
basilisk/shaders/geometry.frag,sha256=6Fcd1mMX5UAslw2GfREuA510UAAKrGdPYQHsaEDqLck,230
|
|
101
|
+
basilisk/shaders/geometry.vert,sha256=2yPpezklovRQczpuf2pUhi4mMv3-YaOjDQCbrzdcdpk,1473
|
|
102
|
+
basilisk/shaders/normal.frag,sha256=I1kU5-u_UeDJJJZLuSU6Dl-9oYmzP040_SLqbGFHWw8,1408
|
|
103
|
+
basilisk/shaders/normal.vert,sha256=4BlcNsIw3fQFsZlfF7VZr6EAV2Y-M-72tXhfaE0uReM,3320
|
|
104
|
+
basilisk/shaders/particle.frag,sha256=6eHqpFT3CgtpNHCJZoHXbsdnzWaCN9Q0VKZZOpCvWfM,2058
|
|
105
|
+
basilisk/shaders/particle.vert,sha256=NbA_WKpxx1IAQt5wso5dZAZRqwVlejPjNdFg_GeJXEE,3313
|
|
106
|
+
basilisk/shaders/sky.frag,sha256=Fr9SQHPKPV9a1mgSeprSiOaFjPrQX9qqZu3Uc_fQT0c,579
|
|
107
|
+
basilisk/shaders/sky.vert,sha256=v_BSdnMiljSJGPqno-J_apAiom38IrBzbDoxM7pIgwI,345
|
|
108
|
+
basilisk_engine-0.1.43.dist-info/METADATA,sha256=lEm2hnpghu9QT3ij963SVj6HQJf_5dwLGkQHVyVoWVo,3882
|
|
109
|
+
basilisk_engine-0.1.43.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
110
|
+
basilisk_engine-0.1.43.dist-info/top_level.txt,sha256=enlSYSf7CUyAly1jmUCNNGInTbaFUjGk4SKwyckZQkw,9
|
|
111
|
+
basilisk_engine-0.1.43.dist-info/RECORD,,
|
basilisk/input/__init__.py
DELETED
|
File without changes
|
basilisk/input/mouse.py
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import pygame as pg
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Mouse():
|
|
5
|
-
def __init__(self, grab=True):
|
|
6
|
-
self.x, self.y = pg.mouse.get_pos()
|
|
7
|
-
self.buttons = pg.mouse.get_pressed()
|
|
8
|
-
self.previous_buttons = pg.mouse.get_pressed()
|
|
9
|
-
self.grab = grab
|
|
10
|
-
|
|
11
|
-
def update(self, events):
|
|
12
|
-
"""
|
|
13
|
-
Updates all mouse state variables.
|
|
14
|
-
Checks for mouse-related events.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
self.x, self.y = pg.mouse.get_pos()
|
|
18
|
-
self.previous_buttons = self.buttons
|
|
19
|
-
self.buttons = pg.mouse.get_pressed()
|
|
20
|
-
|
|
21
|
-
for event in events:
|
|
22
|
-
if event.type == pg.KEYUP:
|
|
23
|
-
if event.key == pg.K_ESCAPE and self.grab:
|
|
24
|
-
# Unlock mouse
|
|
25
|
-
pg.event.set_grab(False)
|
|
26
|
-
pg.mouse.set_visible(True)
|
|
27
|
-
if event.type == pg.MOUSEBUTTONUP and self.grab:
|
|
28
|
-
# Lock mouse
|
|
29
|
-
pg.event.set_grab(True)
|
|
30
|
-
pg.mouse.set_visible(False)
|
|
31
|
-
|
|
32
|
-
def set_pos(self, x, y):
|
|
33
|
-
"""Set the mouse position"""
|
|
34
|
-
pg.mouse.set_pos(x, y)
|
|
35
|
-
|
|
36
|
-
@property
|
|
37
|
-
def click(self): return self.buttons[0] and not self.previous_buttons[0]
|
|
38
|
-
@property
|
|
39
|
-
def left_click(self): return self.buttons[0] and not self.previous_buttons[0]
|
|
40
|
-
@property
|
|
41
|
-
def middle_click(self): return self.buttons[1] and not self.previous_buttons[1]
|
|
42
|
-
@property
|
|
43
|
-
def right_click(self): return self.buttons[2] and not self.previous_buttons[2]
|
|
44
|
-
@property
|
|
45
|
-
def left_down(self): return self.buttons[0]
|
|
46
|
-
@property
|
|
47
|
-
def middle_down(self): return self.buttons[1]
|
|
48
|
-
@property
|
|
49
|
-
def right_down(self): return self.buttons[2]
|
|
50
|
-
|
|
51
|
-
@property
|
|
52
|
-
def grab(self): return self._grab
|
|
53
|
-
|
|
54
|
-
@grab.setter
|
|
55
|
-
def grab(self, value):
|
|
56
|
-
self._grab = value
|
|
57
|
-
if self._grab:
|
|
58
|
-
pg.event.set_grab(True)
|
|
59
|
-
pg.mouse.set_visible(False)
|
|
60
|
-
else:
|
|
61
|
-
pg.event.set_grab(False)
|
|
62
|
-
pg.mouse.set_visible(True)
|
basilisk/input/path.py
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import sys
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
# Credit for function: https://stackoverflow.com/questions/7674790/bundling-data-files-with-pyinstaller-onefile
|
|
6
|
-
def get_root():
|
|
7
|
-
""" Get absolute path to resource, works for dev and for PyInstaller """
|
|
8
|
-
try:
|
|
9
|
-
# PyInstaller creates a temp folder and stores path in _MEIPASS
|
|
10
|
-
base_path = sys._MEIPASS
|
|
11
|
-
except Exception:
|
|
12
|
-
base_path = os.path.abspath(".")
|
|
13
|
-
|
|
14
|
-
return base_path + '/basilisk'
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#version 330 core
|
|
2
|
-
|
|
3
|
-
out vec4 fragColor;
|
|
4
|
-
|
|
5
|
-
in vec2 uv;
|
|
6
|
-
|
|
7
|
-
uniform sampler2D screenTexture;
|
|
8
|
-
uniform sampler2D bloomTexture;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
void main()
|
|
13
|
-
{
|
|
14
|
-
const float gamma = 2.2;
|
|
15
|
-
const float exposure = 1.2;
|
|
16
|
-
vec3 hdrColor = texture(screenTexture, uv).rgb + texture(bloomTexture, uv).rgb / 2;
|
|
17
|
-
|
|
18
|
-
// exposure tone mapping
|
|
19
|
-
vec3 mapped = vec3(1.0) - exp(-hdrColor * exposure);
|
|
20
|
-
// gamma correction
|
|
21
|
-
mapped = pow(mapped, vec3(1.0 / gamma));
|
|
22
|
-
|
|
23
|
-
fragColor = vec4(mapped, 1.0);
|
|
24
|
-
//fragColor = texture(screenTexture, uv) + texture(bloomTexture, uv) / 20000.0;
|
|
25
|
-
}
|