godot/demos/2d/texscreen/lens.tscn

30 lines
944 B
Plaintext

[gd_scene load_steps=5 format=1]
[ext_resource path="res://lens.gd" type="Script" id=1]
[ext_resource path="res://bubble.png" type="Texture" id=2]
[sub_resource type="CanvasItemShader" id=1]
_code = { "fragment":"vec4 normal = tex(TEXTURE,UV);\nvec2 offset = normal.xy * 2.0 - vec2(1.0);\nCOLOR.rgb=texscreen(SCREEN_UV+offset*0.03);\nCOLOR.a=normal.a;\nCOLOR.rgb*=vec3(1.0,0.8,0.7);\n", "fragment_ofs":0, "light":"", "light_ofs":0, "vertex":"", "vertex_ofs":0 }
[sub_resource type="CanvasItemMaterial" id=2]
shader/shader = SubResource( 1 )
shader/shading_mode = 0
[node name="glass" type="BackBufferCopy"]
transform/pos = Vector2( 482.908, 346.807 )
transform/scale = Vector2( 1.31289, 1.34009 )
copy_mode = 1
rect = Rect2( -100, -100, 200, 200 )
script/script = ExtResource( 1 )
[node name="lens" type="Sprite" parent="."]
material/material = SubResource( 2 )
transform/pos = Vector2( 1.6427, -2.90363 )
texture = ExtResource( 2 )