godot-demo-projects/viewport/2d_in_3d
Aaron Franke bbe50fc9da
Convert demos to Godot 4 using regular expressions in a script
2022-03-26 16:09:10 -05:00
..
screenshots Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
2D_in_3D.gd Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
2D_in_3D.tscn Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
README.md Link to the asset library from the README of each demo 2020-09-10 15:37:10 -04:00
ball.png Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
ball.png.import Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
default_env.tres Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
icon.png Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
icon.png.import Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
left_pallete.png Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
left_pallete.png.import Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
pong.gd Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
project.godot Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
right_pallete.png Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
right_pallete.png.import Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
separator.png Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
separator.png.import Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00

README.md

2D in 3D

A demo showing how a 2D scene can be shown within a 3D one using viewports.

Language: GDScript

Renderer: GLES 2

Check out this demo on the asset library: https://godotengine.org/asset-library/asset/129

How does it work?

The Pong game is rendered to a custom Viewport node rather than the main Viewport. In the code, get_texture() is called on the Viewport to get a ViewportTexture, which is then assigned to the quad's material's albedo texture.

Screenshots

Screenshot