Fixed vertex shader compilation error on my intel hd graphics card.

This commit is contained in:
Mono 2021-11-27 14:08:58 +01:00
parent 831145dda8
commit 274b605b05
5 changed files with 10 additions and 54 deletions

View File

@ -4,4 +4,4 @@
[resource]
script = ExtResource( 1 )
aspect_ratio = Vector2( 13.134, 9 )
aspect_ratio = Vector2( 13.252, 10.607 )

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=2]
[gd_scene load_steps=17 format=2]
[ext_resource path="res://TryingOutSomethingNew.gd" type="Script" id=1]
[ext_resource path="res://Node2D.gd" type="Script" id=2]
@ -37,7 +37,7 @@ shader = SubResource( 1 )
shader_param/albedo = Color( 0.768627, 0.231373, 0.231373, 1 )
shader_param/ha = null
[sub_resource type="Image" id=17]
[sub_resource type="Image" id=15]
data = {
"data": PoolByteArray( 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 154, 153, 25, 62, 0, 0, 0, 0, 0, 0, 128, 62, 0, 0, 0, 0, 154, 153, 25, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 154, 153, 25, 190, 0, 0, 0, 0, 0, 0, 128, 62, 0, 0, 0, 0, 154, 153, 25, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63 ),
"format": "RGBAFloat",
@ -49,7 +49,7 @@ data = {
[sub_resource type="ImageTexture" id=16]
flags = 0
flags = 0
image = SubResource( 17 )
image = SubResource( 15 )
size = Vector2( 8, 1 )
[sub_resource type="CapsuleMesh" id=5]
@ -68,7 +68,7 @@ uniform sampler2D table : hint_albedo;
vec4 indx(int i) {
//return vec4(1.0, 1.0, 0.0, 1.0);
return texture(table, vec2(float(i) * 0.125 + 0.0625), 0.5);
return textureLod(table, vec2(float(i) * 0.125 + 0.0625), 0);
}
void vertex() {
@ -107,24 +107,9 @@ void fragment() {
ALBEDO = texture(table, UV).rgb;
}"
[sub_resource type="Image" id=18]
data = {
"data": PoolByteArray( 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 154, 153, 25, 62, 0, 0, 0, 0, 0, 0, 128, 62, 0, 0, 0, 0, 154, 153, 25, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 154, 153, 25, 190, 0, 0, 0, 0, 0, 0, 128, 62, 0, 0, 0, 0, 154, 153, 25, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63 ),
"format": "RGBAFloat",
"height": 1,
"mipmaps": false,
"width": 8
}
[sub_resource type="ImageTexture" id=19]
flags = 0
flags = 0
image = SubResource( 18 )
size = Vector2( 8, 1 )
[sub_resource type="ShaderMaterial" id=7]
shader = SubResource( 6 )
shader_param/table = SubResource( 19 )
shader_param/table = SubResource( 16 )
[sub_resource type="QuadMesh" id=8]

View File

@ -23,7 +23,6 @@ func _check_for_use(event: InputEvent, tool_context: SummerDayToolContext):
var keys = touch_dict.keys()
initial_touches = [touch_dict[keys[0]], touch_dict[keys[1]]]
print(touch_dict)
if event is InputEventScreenDrag:
touch_dict[event.index] = event.position
@ -35,32 +34,6 @@ func _check_for_use(event: InputEvent, tool_context: SummerDayToolContext):
return false
func _run(event: InputEvent, tool_context: SummerDayToolContext):
# var jump := Transform2D.IDENTITY
#
# # Calculate scale.
# var initial_distance = initial_touches[0].distance_to(initial_touches[1])
# var current_distance = current_touches[0].distance_to(current_touches[1])
# var scale = current_distance / initial_distance
#
# # Calculate rotation.
# var initial_angle = initial_touches[0].angle_to_point(initial_touches[1])
# var current_angle = current_touches[0].angle_to_point(current_touches[1])
# var rotation = current_angle - initial_angle
#
# jump = jump.scaled(Vector2(scale, scale)).rotated(rotation)
#
# # Calculate origin.
# var transformed_initial_touch = jump.xform(initial_touches[0])
# var offset = current_touches[0] - transformed_initial_touch
#
# #print(jump)
# jump.origin = offset
# #jump = jump.translated(offset)
# #print(jump)
#
# var transform = jump * initial_transform
# #print(transform)
var init_set = [
initial_touches[0],
initial_touches[1],
@ -80,8 +53,6 @@ func _run(event: InputEvent, tool_context: SummerDayToolContext):
curr_set[0], curr_set[1], curr_set[2], curr_set[3]
)
#print(basis)
var transform = Transform2D(
Vector2(basis.x.x, basis.x.y),
Vector2(basis.y.x, basis.y.y),

View File

@ -9,7 +9,3 @@ func _init():
SummerDayZoomCanvasTool.new(),
SummerDayRotationCanvasTool.new(),
]
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

View File

@ -154,6 +154,10 @@ config/icon="res://icon.png"
Util="res://addons/summer_day/utilities/math_helper.gd"
[editor_plugins]
enabled=PoolStringArray( "res://addons/summer_day/plugin.cfg" )
[gdnative]
singletons=[ "res://addons/godot-git-plugin/git_api.gdnlib" ]