Add README files to Viewport demos

This commit is contained in:
Aaron Franke
2020-03-08 01:35:19 -04:00
parent 2eaedf8064
commit f2a18910aa
20 changed files with 114 additions and 16 deletions

View File

@@ -0,0 +1,20 @@
# 2D in 3D
A demo showing how a 2D scene can be shown within a 3D one using viewports.
Language: GDScript
Renderer: GLES 2
## How does it work?
The Pong game is rendered to a custom
[`Viewport`](https://docs.godotengine.org/en/latest/classes/class_viewport.html)
node rather than the main Viewport. In the code,
`get_texture()` is called on the Viewport to get a
[`ViewportTexture`](https://docs.godotengine.org/en/latest/classes/class_viewporttexture.html),
which is then assigned to the quad's material's albedo texture.
## Screenshots
![Screenshot](screenshots/pong.png)

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -0,0 +1,20 @@
# 3D in 2D
A demo showing how a 3D scene can be shown within a 2D one using viewports.
Language: GDScript
Renderer: GLES 2
## How does it work?
The 3D robot is rendered to a custom
[`Viewport`](https://docs.godotengine.org/en/latest/classes/class_viewport.html)
node rather than the main Viewport. In the code,
`get_texture()` is called on the Viewport to get a
[`ViewportTexture`](https://docs.godotengine.org/en/latest/classes/class_viewporttexture.html),
which is then assigned to the sprite's texture.
## Screenshots
![Screenshot](screenshots/3d_in_2d.png)

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -1,4 +1,4 @@
# 3D scaling
# 3D Viewport Scaling
This demo shows how to scale the 3D viewport rendering without affecting
2D elements such as the HUD. It also demonstrates how to toggle filtering
@@ -9,3 +9,13 @@ the main game area and a non-pixel-art viewport for HUD elements.
ViewportContainer can also be used to display a viewport in a GUI, but it
doesn't offer the ability to enable filtering.
Language: GDScript
Renderer: GLES 2
## Screenshots
![Screenshot](screenshots/high.png)
![Screenshot](screenshots/low.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -1,24 +1,49 @@
# The project
This sample project showcases an implementation of dynamic split screen, also called Voronoi split screen, using the [Godot engine](https://godotengine.org).
# Dynamic Split Screen
# Dynamic split screen
A dynamic split screen system displays a single screen when the two players are close but a splitted view when they move apart.
This sample project showcases an implementation of dynamic
split screen, also called Voronoi split screen.
The splitting line can take any angle depending on the players' position, so it won't be either vertical or horizontal.
Language: [GDSL](https://docs.godotengine.org/en/latest/tutorials/shading/shading_reference/shading_language.html) and GDScript
Renderer: GLES 2
Note: An HTML5 export is testable
[here](https://benjaminnavarro.github.io/godot_dynamic_split_screen/index.html).
## Details
A dynamic split screen system displays a single screen when
the two players are close but a splitted view when they move apart.
The splitting line can take any angle depending on the players'
position, so it won't be either vertical or horizontal.
This system was popularized by the Lego videogames.
# How it works
Two cameras are placed inside two separate viewports and their texture, as well as some other parameters, are passed to a shader attached to a TextureRect filling the whole screen.
## How it works
The `SplitScreen` shader, with the help of the `CameraController` script, chooses wich texture to display on each pixel to achieve the effect.
Two cameras are placed inside two separate viewports and their
texture, as well as some other parameters, are passed to a
shader attached to a TextureRect filling the whole screen.
The cameras are placed on the segment joining the two players, either in the middle if they're close enough or at a fixed distance otherwise.
The `SplitScreen` shader, with the help of the `CameraController`
script, chooses wich texture to display on each pixel to
achieve the effect.
# How to use it
Open and launch the project inside the Godot engine and then you can use WASD keys to move the first player and IJKL keys to move the second one.
The cameras are placed on the segment joining the two players,
either in the middle if they're close enough or at a fixed
distance otherwise.
The `Cameras` node has parameters to tune the distance at which the screen splits and also the width and color of the splitting line.
## How to use it
# Try it out
An HTML5 export is testable [here](https://benjaminnavarro.github.io/godot_dynamic_split_screen/index.html).
Open and launch the project inside the Godot engine and then
you can use WASD keys to move the first player and IJKL keys
to move the second one.
The `Cameras` node has parameters to tune the distance at
which the screen splits and also the width and color of
the splitting line.
## Screenshots
![Screenshots](screenshots/splitscreen.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,12 @@
# GUI in 3D
A demo showing a GUI instanced within a 3D scene using viewports,
as well as forwarding mouse and keyboard input to the GUI.
Language: GDScript
Renderer: GLES 3
## Screenshots
![Screenshot](screenshots/gui.png)

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View File

@@ -0,0 +1,11 @@
# Screen Capture
An example showing how to take screenshots of the screen.
Language: GDScript
Renderer: GLES 2
## Screenshots
![Screenshot](screenshots/capture.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 KiB

View File

@@ -10,4 +10,4 @@ Note: There is a GDScript version available [here](https://github.com/godotengin
## Screenshots
![Screenshot](screenshots/multitouch.png)
![Screenshot](../../misc/multitouch_view/screenshots/multitouch.png)