godot-demo-projects/viewport/2d_in_3d
Hugo Locurcio 2c2c89e040
Improve 2D in 3D demo (#814)
2023-01-17 21:37:16 +01:00
..
screenshots Improve 2D in 3D demo (#814) 2023-01-17 21:37:16 +01:00
2d_in_3d.gd Improve 2D in 3D demo (#814) 2023-01-17 21:37:16 +01:00
2d_in_3d.tscn Improve 2D in 3D demo (#814) 2023-01-17 21:37:16 +01:00
README.md Improve 2D in 3D demo (#814) 2023-01-17 21:37:16 +01:00
ball.png Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
ball.png.import Update most demos for Godot 4.0.beta10 (#782) 2023-01-05 16:50:17 +01: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 Update most demos for Godot 4.0.beta10 (#782) 2023-01-05 16:50:17 +01:00
left_pallete.png Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
left_pallete.png.import Update most demos for Godot 4.0.beta10 (#782) 2023-01-05 16:50:17 +01:00
pong.gd Use StringName literals with Input methods 2022-03-27 19:19:09 -05:00
project.godot Improve 2D in 3D demo (#814) 2023-01-17 21:37:16 +01:00
right_pallete.png Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
right_pallete.png.import Update most demos for Godot 4.0.beta10 (#782) 2023-01-05 16:50:17 +01:00
separator.png Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
separator.png.import Update most demos for Godot 4.0.beta10 (#782) 2023-01-05 16:50:17 +01:00

README.md

2D in 3D

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

Language: GDScript

Renderer: Forward Mobile

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