mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-18 01:06:47 +01:00
Fixed a few copy-paste errors, and removed 3 old nodes with test implementation.
This commit is contained in:
parent
1c988c54ed
commit
16910b5110
@ -91,7 +91,7 @@ extends Reference
|
||||
static func clampv3(v : Vector3, mi : Vector3, ma : Vector3) -> Vector3:
|
||||
v.x = clamp(v.x, mi.x, ma.x)
|
||||
v.y = clamp(v.y, mi.y, ma.y)
|
||||
v.y = clamp(v.z, mi.z, ma.z)
|
||||
v.z = clamp(v.z, mi.z, ma.z)
|
||||
|
||||
return v
|
||||
|
||||
@ -147,7 +147,7 @@ static func absv2(v : Vector2) -> Vector2:
|
||||
static func absv3(v : Vector3) -> Vector3:
|
||||
v.x = abs(v.x)
|
||||
v.y = abs(v.y)
|
||||
v.y = abs(v.y)
|
||||
v.z = abs(v.y)
|
||||
|
||||
return v
|
||||
|
||||
@ -160,7 +160,7 @@ static func cosv2(v : Vector2) -> Vector2:
|
||||
static func cosv3(v : Vector3) -> Vector3:
|
||||
v.x = cos(v.x)
|
||||
v.y = cos(v.y)
|
||||
v.y = cos(v.y)
|
||||
v.z = cos(v.z)
|
||||
|
||||
return v
|
||||
|
||||
|
@ -1,79 +0,0 @@
|
||||
tool
|
||||
extends MMNode
|
||||
|
||||
var Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
var Filter = preload("res://addons/mat_maker_gd/nodes/common/filter.gd")
|
||||
var Shapes = preload("res://addons/mat_maker_gd/nodes/common/shapes.gd")
|
||||
|
||||
var image : Image
|
||||
var tex : ImageTexture
|
||||
|
||||
export(Vector2) var bmin : Vector2 = Vector2(0.1, 0.1)
|
||||
export(Vector2) var bmax : Vector2 = Vector2(1, 1)
|
||||
|
||||
export(bool) var refresh setget reff,reffg
|
||||
|
||||
func _ready():
|
||||
if !Engine.editor_hint:
|
||||
gen()
|
||||
|
||||
|
||||
func gen() -> void:
|
||||
if !image:
|
||||
image = Image.new()
|
||||
image.create(300, 300, false, Image.FORMAT_RGBA8)
|
||||
|
||||
if !tex:
|
||||
tex = ImageTexture.new()
|
||||
|
||||
# var bmin : Vector2 = Vector2(0.1, 0.1)
|
||||
# var bmax : Vector2 = Vector2(1, 1)
|
||||
|
||||
image.lock()
|
||||
|
||||
var w : float = image.get_width()
|
||||
var h : float = image.get_width()
|
||||
|
||||
var pseed : float = randf() + randi()
|
||||
|
||||
for x in range(image.get_width()):
|
||||
for y in range(image.get_height()):
|
||||
var v : Vector2 = Vector2(x / w, y / h)
|
||||
|
||||
var f : float = Shapes.shape_circle(v, 3, 1.0 * 1.0, 1.0)
|
||||
var c : Color = Color(f, f, f, 1)
|
||||
|
||||
# c = invert(c)
|
||||
# c = brightness_contrast(c)
|
||||
|
||||
#needs work
|
||||
c = adjust_hsv(c)
|
||||
|
||||
image.set_pixel(x, y, c)
|
||||
|
||||
|
||||
image.unlock()
|
||||
|
||||
tex.create_from_image(image)
|
||||
#texture = tex
|
||||
|
||||
var p_o91644_brightness = 0.000000000;
|
||||
var p_o91644_contrast = 1.000000000;
|
||||
|
||||
func brightness_contrast(color : Color) -> Color:
|
||||
return Filter.brightness_contrast(color, p_o91644_brightness, p_o91644_contrast);
|
||||
|
||||
var p_o102649_hue = 0.000000000;
|
||||
var p_o102649_saturation = 1.000000000;
|
||||
var p_o102649_value = 1.000000000;
|
||||
|
||||
func adjust_hsv(color : Color) -> Color:
|
||||
return Filter.adjust_hsv(color, p_o102649_hue, p_o102649_saturation, p_o102649_value)
|
||||
|
||||
func reffg():
|
||||
return false
|
||||
|
||||
func reff(bb):
|
||||
if bb:
|
||||
gen()
|
||||
|
@ -1,68 +0,0 @@
|
||||
tool
|
||||
extends MMNode
|
||||
|
||||
var Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
var Filter = preload("res://addons/mat_maker_gd/nodes/common/filter.gd")
|
||||
var Shapes = preload("res://addons/mat_maker_gd/nodes/common/shapes.gd")
|
||||
|
||||
var image : Image
|
||||
var tex : ImageTexture
|
||||
|
||||
export(Vector2) var bmin : Vector2 = Vector2(0.1, 0.1)
|
||||
export(Vector2) var bmax : Vector2 = Vector2(1, 1)
|
||||
|
||||
export(bool) var refresh setget reff,reffg
|
||||
|
||||
func _ready():
|
||||
if !Engine.editor_hint:
|
||||
gen()
|
||||
|
||||
|
||||
func gen() -> void:
|
||||
if !image:
|
||||
image = Image.new()
|
||||
image.create(300, 300, false, Image.FORMAT_RGBA8)
|
||||
|
||||
if !tex:
|
||||
tex = ImageTexture.new()
|
||||
|
||||
# var bmin : Vector2 = Vector2(0.1, 0.1)
|
||||
# var bmax : Vector2 = Vector2(1, 1)
|
||||
|
||||
image.lock()
|
||||
|
||||
var w : float = image.get_width()
|
||||
var h : float = image.get_width()
|
||||
|
||||
var pseed : float = randf() + randi()
|
||||
|
||||
for x in range(image.get_width()):
|
||||
for y in range(image.get_height()):
|
||||
var v : Vector2 = Vector2(x / w, y / h)
|
||||
|
||||
var f : float = Shapes.shape_circle(v, 3, 1.0 * 1.0, 1.0)
|
||||
|
||||
f = Filter.grayscale_luminosity(Vector3(f, f, f));
|
||||
|
||||
var c : Color = Color(f, f, f, 1)
|
||||
|
||||
# c = invert(c)
|
||||
# c = brightness_contrast(c)
|
||||
|
||||
#needs work
|
||||
|
||||
image.set_pixel(x, y, c)
|
||||
|
||||
|
||||
image.unlock()
|
||||
|
||||
tex.create_from_image(image)
|
||||
# texture = tex
|
||||
|
||||
func reffg():
|
||||
return false
|
||||
|
||||
func reff(bb):
|
||||
if bb:
|
||||
gen()
|
||||
|
@ -1,80 +0,0 @@
|
||||
tool
|
||||
extends MMNode
|
||||
|
||||
var Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
||||
var image : Image
|
||||
var tex : ImageTexture
|
||||
|
||||
export(Vector2) var bmin : Vector2 = Vector2(0.1, 0.1)
|
||||
export(Vector2) var bmax : Vector2 = Vector2(1, 1)
|
||||
|
||||
export(bool) var refresh setget reff,reffg
|
||||
|
||||
func _ready():
|
||||
if !Engine.editor_hint:
|
||||
gen()
|
||||
|
||||
|
||||
func gen() -> void:
|
||||
if !image:
|
||||
image = Image.new()
|
||||
image.create(300, 300, false, Image.FORMAT_RGBA8)
|
||||
|
||||
if !tex:
|
||||
tex = ImageTexture.new()
|
||||
|
||||
# var bmin : Vector2 = Vector2(0.1, 0.1)
|
||||
# var bmax : Vector2 = Vector2(1, 1)
|
||||
|
||||
image.lock()
|
||||
|
||||
var w : float = image.get_width()
|
||||
var h : float = image.get_width()
|
||||
|
||||
var pseed : float = randf() + randi()
|
||||
|
||||
for x in range(image.get_width()):
|
||||
for y in range(image.get_height()):
|
||||
var v : Vector2 = Vector2(x / w, y / h)
|
||||
|
||||
var f : Vector3 = sharpen(v)
|
||||
|
||||
var c : Color = Color(f.x, f.y, f.z, 1)
|
||||
|
||||
# c = invert(c)
|
||||
# c = brightness_contrast(c)
|
||||
|
||||
#needs work
|
||||
|
||||
image.set_pixel(x, y, c)
|
||||
|
||||
|
||||
image.unlock()
|
||||
|
||||
tex.create_from_image(image)
|
||||
# texture = tex
|
||||
|
||||
func o11853_input_in(uv : Vector2) -> Vector3:
|
||||
var f : float = Commons.shape_circle(uv, 3, 1.0 * 1.0, 1.0)
|
||||
|
||||
return Vector3(f, f, f);
|
||||
|
||||
func sharpen(uv : Vector2) -> Vector3:
|
||||
var e : Vector2 = Vector2(1.0 / 32.000000000, 0.0);
|
||||
var rv : Vector3 = 5.0 * o11853_input_in(uv);
|
||||
|
||||
rv -= o11853_input_in(uv + Vector2(e.x, e.y));
|
||||
rv -= o11853_input_in(uv - Vector2(e.x, e.y));
|
||||
rv -= o11853_input_in(uv + Vector2(e.y, e.x));
|
||||
rv -= o11853_input_in(uv - Vector2(e.y, e.x));
|
||||
|
||||
return rv
|
||||
|
||||
func reffg():
|
||||
return false
|
||||
|
||||
func reff(bb):
|
||||
if bb:
|
||||
gen()
|
||||
|
Loading…
Reference in New Issue
Block a user