Skip to content

Naruto #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3a91299
create project folde
Mar 5, 2025
b3e918a
test
Mar 5, 2025
db3ddaf
creation mon exemple
Mar 11, 2025
8bd548c
Animation oeil rouge qui tourne avec pupille qui pulse
redalhdd Mar 11, 2025
345c6c6
Ajout du dossier project
redalhdd Mar 11, 2025
b9bc213
RINNEGAN
Saadmadi Mar 11, 2025
1646b83
Presque sharingan
redalhdd Mar 11, 2025
af05911
Presque sharingan encore
redalhdd Mar 11, 2025
4ea7fa4
Sharingan
redalhdd Mar 12, 2025
3d43fae
V1
Saadmadi Mar 13, 2025
052f6d7
Sharingan + lumière
redalhdd Mar 13, 2025
baa2058
Sharingan près pour intégration rinnegan
redalhdd Mar 13, 2025
0f85a18
quadrillage rose
Mar 13, 2025
6b0a219
quadrillage rose point de fuite
Mar 13, 2025
2b4cc76
antialiasing + mailles fines
Mar 13, 2025
0763b5b
changement background flames minimalistes
Mar 17, 2025
f0dd731
comment flammes
Mar 17, 2025
086e9ac
Sharingan + Rinnegan
redalhdd Mar 17, 2025
f1d5e0d
edit folder name
Mar 17, 2025
356a05b
remove read.me
Mar 17, 2025
c62bab1
Merge branch 'main' of github.com:NassihClement/ComputeShaderStudio
Mar 17, 2025
860cff0
résolution conflicts
Mar 17, 2025
1a9f3c1
qq modifs
redalhdd Mar 17, 2025
d7ed6e0
Merge Réda vers main
redalhdd Mar 17, 2025
e7c70d5
Sharingan + Rinnegan + Background
redalhdd Mar 17, 2025
a0d90c4
clean + readme
Mar 17, 2025
5479791
suppressions fichiers inutilisés
Mar 17, 2025
e67de46
ajout commentaires
Mar 17, 2025
dfa52d8
résolution erreur avant presentation
Mar 18, 2025
91cc1e7
résolution conflits avant pull request
Mar 18, 2025
e611451
edit readme
Mar 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .gitattributes
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ mono_crash.*.json
.DS_Store
screenshots/.DS_Store
*.tmp

# Editor-specific ignores
.vscode/
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "linux-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "linux-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": false,
"cwd": "/media/clem/SSD-Clem/master/m1/s8/AAP/godot/ComputeShaderStudio/examples/backgroundClement",
"program": "/media/clem/SSD-Clem/master/m1/s8/AAP/godot/ComputeShaderStudio/examples/backgroundClement/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
59 changes: 59 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[gd_scene format=3 uid="uid://c602ywnkwddt3"]

[node name="G" type="Node2D"]
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions addons/compute_shader_studio/compute_shader_studio_2d.gd
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,7 @@ func screen_to_data0(pos : Vector2):
return pos;
else:
return Vector2(0,0)


func _on_check_button_button_up() -> void:
pass # Replace with function body.
Empty file modified addons/compute_shader_studio/compute_shader_studio_plugin.gd
100644 → 100755
Empty file.
Empty file modified addons/compute_shader_studio/icon.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified addons/compute_shader_studio/plugin.cfg
100644 → 100755
Empty file.
Empty file modified doc/ComputeShaderStudio.pdf
100644 → 100755
Empty file.
Empty file modified examples/LabelStepPass.gd
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions examples/basic_examples/example_2.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ horizontal_alignment = 1
vertical_alignment = 1

[node name="Label2" type="Label" parent="."]
offset_left = 29.0
offset_top = 76.0
offset_right = 336.0
offset_bottom = 405.0
offset_left = -80.0
offset_top = 41.0
offset_right = 227.0
offset_bottom = 370.0
scale = Vector2(1.72, 1.72)
text = "// Select the node ComputeShader
// to write your GLSL code
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_examples/example_3.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[ext_resource type="Script" uid="uid://jw3o2qu3a0pl" path="res://examples/LabelStepPass.gd" id="2_4aq4t"]
[ext_resource type="Texture2D" uid="uid://demftcowdd5c6" path="res://examples/icon.svg" id="2_4upxj"]

[node name="CompShadStudioEx3" type="Node2D"]
[node name="CompShadStudioEx4" type="Node2D"]

[node name="ComputeShaderStudio2D2" type="Node" parent="." node_paths=PackedStringArray("data")]
script = ExtResource("1_eimw3")
Expand Down
46 changes: 37 additions & 9 deletions examples/basic_examples/example_5.cpp
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
// Write your code HERE
void main() {
uint x = gl_GlobalInvocationID.x;
uint y = gl_GlobalInvocationID.y;
uint p = x + y * WSX;
int dx = int(WSX)/2 - int(x);
int dy = int(WSY)/2 - int(y);
int r = int(64.0*sin(step/100.0));
int d = int(dx*dx+dy*dy) ;
data_0[p] = 0xFF000000 - 600* (d + step) ;
uint x = gl_GlobalInvocationID.x;
uint y = gl_GlobalInvocationID.y;
uint p = x + y * WSX;

int dx = int(WSX) / 2 - int(x);
int dy = int(WSY) / 2 - int(y);

int d = dx * dx + dy * dy;

// Condition : après 5 secondes (ajuste la valeur selon ton framerate)
if (step > 300) { // Après 5 secondes -> Afficher les cercles

float d = sqrt(float(dx * dx + dy * dy)); // Distance au centre

// Animation des cercles (pulsation)
float amplitude = 10.0; // Amplitude de la pulsation
float vitesse = 0.08; // Vitesse de l'effet
float animatedD = d + amplitude * sin(float(step) * vitesse);

// Espacement animé des cercles
float spacing = 30.0 + 10.0 * sin(float(step) * 0.1);

// Calcul des cercles noirs avec un motif en anneaux
float rings = mod(animatedD, spacing);
bool isBlack = rings < 6.0; // Épaisseur des anneaux noirs

if (isBlack) {
data_0[p] = 0xFF000000; // Noir
} else {
data_0[p] = 0xFF800080; // Fond violet
}

} else {
int value = clamp(600 * (d + int(step)), 0, 0xFFFFFF);
data_0[p] = 0xFF000000 | (0xFFFFFF - value); // Rendu normal
}
}

12 changes: 6 additions & 6 deletions examples/basic_examples/example_5.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

[ext_resource type="Script" uid="uid://c8esqdv0y26yp" path="res://addons/compute_shader_studio/compute_shader_studio_2d.gd" id="1_cogap"]

[sub_resource type="FastNoiseLite" id="FastNoiseLite_pm7bb"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_ynclj"]

[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_nxi5j"]
width = 256
height = 128
noise = SubResource("FastNoiseLite_pm7bb")
noise = SubResource("FastNoiseLite_ynclj")

[node name="CompShadStudioEx5" type="Node2D"]

Expand All @@ -31,8 +31,8 @@ horizontal_alignment = 1
vertical_alignment = 1

[node name="TextureRect" type="TextureRect" parent="."]
offset_left = 278.0
offset_top = 192.0
offset_right = 975.0
offset_bottom = 629.0
offset_left = -10.0
offset_top = -26.0
offset_right = 1171.0
offset_bottom = 667.0
texture = SubResource("NoiseTexture2D_nxi5j")
Empty file modified examples/cells/cells.gd
100644 → 100755
Empty file.
Empty file modified examples/cells/example_cells.c
100644 → 100755
Empty file.
92 changes: 14 additions & 78 deletions examples/cells/example_cells.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=3 format=3 uid="uid://cutxgtalwsp6q"]
[gd_scene load_steps=5 format=3 uid="uid://cutxgtalwsp6q"]

[ext_resource type="Script" uid="uid://bs2f5sxok3d3i" path="res://examples/cells/cells.gd" id="1_dw4h8"]
[ext_resource type="Texture2D" uid="uid://demftcowdd5c6" path="res://examples/icon.svg" id="2_oji6h"]
Expand All @@ -17,83 +17,19 @@ WSY = 256
nb_passes_cyto = 20
nb_passes_memb = 14
glsl_file = "res://examples/cells/example_cells.c"
data = [NodePath("CenterAnchor/Display"), null, null, null, null, null, null, null, null, null, null, null, null]
data = [null, null, null, null, null, null, null, null, null, null, null, null, null]

[node name="CenterAnchor" type="Control" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2

[node name="Display" type="Sprite2D" parent="CenterAnchor"]
texture_filter = 1
scale = Vector2(4, 4)
texture = ExtResource("2_oji6h")

[node name="DisplayNormalButton" type="Button" parent="."]
layout_mode = 0
offset_left = 8.0
offset_top = 8.0
offset_right = 248.0
offset_bottom = 56.0
text = "Display Regular"

[node name="DisplayCytoplasmButton" type="Button" parent="."]
layout_mode = 0
offset_left = 8.0
offset_top = 72.0
offset_right = 248.0
offset_bottom = 120.0
text = "Display Cytoplasm Field"

[node name="DisplayCytoplasmButton2" type="Button" parent="."]
layout_mode = 0
offset_left = 8.0
offset_top = 136.0
offset_right = 248.0
offset_bottom = 184.0
text = "Display Cytoplasm Field (Flat)"

[node name="DisplayMembranes" type="Button" parent="."]
layout_mode = 0
offset_left = 8.0
offset_top = 200.0
offset_right = 248.0
offset_bottom = 248.0
text = "Display Membranes"
[node name="ComputeShaderStudio2D2" type="Node" parent="." node_paths=PackedStringArray("data")]
script = ExtResource("2_6o5l7")
WSX = 256
glsl_file = "res://examples/project/base.cpp"
GLSL_code = ""
data = [null]

[node name="DisplayMembraneField" type="Button" parent="."]
[node name="TextureRect" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 8.0
offset_top = 264.0
offset_right = 248.0
offset_bottom = 312.0
text = "Display Membrane Field"

[node name="RichTextLabel" type="RichTextLabel" parent="."]
layout_mode = 1
anchors_preset = 11
anchor_left = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -320.0
grow_horizontal = 0
grow_vertical = 2
theme_override_font_sizes/normal_font_size = 20
text = "- Step 1: Plop cytoplasm fields at center positions
- Step 2: Diffuse cytoplasm field
- Step 3: At cytoplasm edges, plop membranes
- Step 4: Diffuse membrane field
- Step 5: At centers, push in direction where membrane field is weakest
- Step 6: move centers
- Display & Repeat"

[connection signal="pressed" from="DisplayNormalButton" to="." method="set_display_normal"]
[connection signal="pressed" from="DisplayCytoplasmButton" to="." method="set_display_cytoplasm"]
[connection signal="pressed" from="DisplayCytoplasmButton2" to="." method="set_display_cytoplasm_flat"]
[connection signal="pressed" from="DisplayMembranes" to="." method="set_display_membranes"]
[connection signal="pressed" from="DisplayMembraneField" to="." method="set_display_membrane_field"]
offset_left = 127.0
offset_top = 5.0
offset_right = 824.0
offset_bottom = 442.0
texture = SubResource("NoiseTexture2D_0uqft")
Empty file modified examples/circles/circles.cpp
100644 → 100755
Empty file.
Empty file modified examples/circles/circles.tscn
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions examples/example_1.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ void main() {
uint y = gl_GlobalInvocationID.y;
uint p = x + y * WSX;
data_0[p] = 0xFFFF0000 - int(x+y*1024)*(step);

}
Empty file modified examples/example_1.glsl.import
100644 → 100755
Empty file.
40 changes: 40 additions & 0 deletions examples/example_mandelbrot.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
extends Node

var css : Node

var zoom : float = 1.0
var pos : Vector2 = Vector2(-0.75, 0)

var grab : Vector2
var grabbing : bool = false

func screen_to_world(screen : Vector2):
var pos_data0 : Vector2 = css.screen_to_data0(screen)
var wsize : Vector2 = Vector2(css.WSX, css.WSY);
return pos + (pos_data0 / wsize - Vector2(0.5, 0.5)) * 4.0 / zoom;

func _ready():
css = get_node("ComputeShaderStudio2D")
css.uniform_user_data.resize(4*3)

func _process(_delta):
css.uniform_user_data.encode_float(0, zoom)
css.uniform_user_data.encode_float(4, pos.x)
css.uniform_user_data.encode_float(8, pos.y)

func _input(event):
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_WHEEL_UP :
zoom *= 1.1
elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN :
zoom /= 1.1
elif event.button_index == MOUSE_BUTTON_LEFT :
if event.pressed : # Start panning
grab = screen_to_world(event.position)
grabbing = true
else : # Stop panning
grabbing = false

elif event is InputEventMouse and grabbing : # Panning
var delta : Vector2 = screen_to_world(event.position) - grab
pos -= delta
1 change: 1 addition & 0 deletions examples/example_mandelbrot.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://n4ra8rjo3hu
Empty file modified examples/grid_512x512.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified examples/grid_image_licence.txt
100644 → 100755
Empty file.
Empty file modified examples/icon.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified examples/lenia.cpp
100644 → 100755
Empty file.
Empty file modified examples/mandelbrot/example_mandelbrot.tscn
100644 → 100755
Empty file.
Empty file modified examples/misc/example_laser.tscn
100644 → 100755
Empty file.
18 changes: 18 additions & 0 deletions examples/naruto/backgroundClement/TestExample.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3 uid="uid://ddfhk06k1ymy"]

[ext_resource type="Script" path="res://addons/compute_shader_studio/compute_shader_studio_2d.gd" id="1_bowy1"]
[ext_resource type="Texture2D" uid="uid://demftcowdd5c6" path="res://examples/icon.svg" id="2_n443p"]

[node name="background" type="Node2D"]

[node name="ComputeShaderStudio2D" type="Node" parent="." node_paths=PackedStringArray("data")]
script = ExtResource("1_bowy1")
glsl_file = "res://examples/backgroundClement/background.cpp"
GLSL_code = "
"
data = [NodePath("../Sprite2D")]

[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(369, 246)
scale = Vector2(3.60063, 3.6475)
texture = ExtResource("2_n443p")
Loading