New option to send canvas to render buffer
allows to use 3D environment effects for post processing such as Glow, Bloom, HDR, etc. in 2D.
This commit is contained in:
26
demos/2d/hdr/beach_cave.gd
Normal file
26
demos/2d/hdr/beach_cave.gd
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
extends Node2D
|
||||
|
||||
# member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
const CAVE_LIMIT=1000
|
||||
|
||||
func _input(ev):
|
||||
if (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask&1):
|
||||
var rel_x = ev.relative_x
|
||||
var cavepos = get_node("cave").get_pos()
|
||||
cavepos.x+=rel_x
|
||||
if (cavepos.x<-CAVE_LIMIT):
|
||||
cavepos.x=-CAVE_LIMIT
|
||||
elif (cavepos.x>0):
|
||||
cavepos.x=0
|
||||
get_node("cave").set_pos(cavepos)
|
||||
|
||||
|
||||
func _ready():
|
||||
set_process_input(true)
|
||||
# Initialization here
|
||||
pass
|
||||
|
||||
|
||||
BIN
demos/2d/hdr/beach_cave.scn
Normal file
BIN
demos/2d/hdr/beach_cave.scn
Normal file
Binary file not shown.
13
demos/2d/hdr/engine.cfg
Normal file
13
demos/2d/hdr/engine.cfg
Normal file
@ -0,0 +1,13 @@
|
||||
[application]
|
||||
|
||||
name="HDR for 2D"
|
||||
main_scene="res://beach_cave.scn"
|
||||
|
||||
[display]
|
||||
|
||||
width=1080
|
||||
height=720
|
||||
|
||||
[rasterizer]
|
||||
|
||||
blur_buffer_size=128
|
||||
BIN
demos/2d/hdr/ocean_beach.png
Normal file
BIN
demos/2d/hdr/ocean_beach.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 433 KiB |
1
demos/2d/hdr/ocean_beach.png.flags
Normal file
1
demos/2d/hdr/ocean_beach.png.flags
Normal file
@ -0,0 +1 @@
|
||||
tolinear=true
|
||||
BIN
demos/2d/hdr/ocean_cave.png
Normal file
BIN
demos/2d/hdr/ocean_cave.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 728 KiB |
1
demos/2d/hdr/ocean_cave.png.flags
Normal file
1
demos/2d/hdr/ocean_cave.png.flags
Normal file
@ -0,0 +1 @@
|
||||
tolinear=true
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user