diff --git a/viewport/2d_in_3d/README.md b/viewport/2d_in_3d/README.md new file mode 100644 index 00000000..39424770 --- /dev/null +++ b/viewport/2d_in_3d/README.md @@ -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) diff --git a/viewport/2d_in_3d/screenshots/.gdignore b/viewport/2d_in_3d/screenshots/.gdignore new file mode 100644 index 00000000..e69de29b diff --git a/viewport/2d_in_3d/screenshots/pong.png b/viewport/2d_in_3d/screenshots/pong.png new file mode 100644 index 00000000..adad8d91 Binary files /dev/null and b/viewport/2d_in_3d/screenshots/pong.png differ diff --git a/viewport/3d_in_2d/README.md b/viewport/3d_in_2d/README.md new file mode 100644 index 00000000..60fc8fc6 --- /dev/null +++ b/viewport/3d_in_2d/README.md @@ -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) diff --git a/viewport/3d_in_2d/screenshots/.gdignore b/viewport/3d_in_2d/screenshots/.gdignore new file mode 100644 index 00000000..e69de29b diff --git a/viewport/3d_in_2d/screenshots/3d_in_2d.png b/viewport/3d_in_2d/screenshots/3d_in_2d.png new file mode 100644 index 00000000..e4a5ca36 Binary files /dev/null and b/viewport/3d_in_2d/screenshots/3d_in_2d.png differ diff --git a/viewport/3d_scaling/README.md b/viewport/3d_scaling/README.md index c89ba8c3..7c86717f 100644 --- a/viewport/3d_scaling/README.md +++ b/viewport/3d_scaling/README.md @@ -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) diff --git a/viewport/3d_scaling/screenshots/.gdignore b/viewport/3d_scaling/screenshots/.gdignore new file mode 100644 index 00000000..e69de29b diff --git a/viewport/3d_scaling/screenshots/high.png b/viewport/3d_scaling/screenshots/high.png new file mode 100644 index 00000000..e7cd08d5 Binary files /dev/null and b/viewport/3d_scaling/screenshots/high.png differ diff --git a/viewport/3d_scaling/screenshots/low.png b/viewport/3d_scaling/screenshots/low.png new file mode 100644 index 00000000..27f5f8f3 Binary files /dev/null and b/viewport/3d_scaling/screenshots/low.png differ diff --git a/viewport/dynamic_split_screen/README.md b/viewport/dynamic_split_screen/README.md index d6dc097c..ea608dfb 100644 --- a/viewport/dynamic_split_screen/README.md +++ b/viewport/dynamic_split_screen/README.md @@ -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) diff --git a/viewport/dynamic_split_screen/screenshots/.gdignore b/viewport/dynamic_split_screen/screenshots/.gdignore new file mode 100644 index 00000000..e69de29b diff --git a/viewport/dynamic_split_screen/screenshots/splitscreen.png b/viewport/dynamic_split_screen/screenshots/splitscreen.png new file mode 100644 index 00000000..08282e6b Binary files /dev/null and b/viewport/dynamic_split_screen/screenshots/splitscreen.png differ diff --git a/viewport/gui_in_3d/README.md b/viewport/gui_in_3d/README.md new file mode 100644 index 00000000..4a98aca5 --- /dev/null +++ b/viewport/gui_in_3d/README.md @@ -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) diff --git a/viewport/gui_in_3d/screenshots/.gdignore b/viewport/gui_in_3d/screenshots/.gdignore new file mode 100644 index 00000000..e69de29b diff --git a/viewport/gui_in_3d/screenshots/gui.png b/viewport/gui_in_3d/screenshots/gui.png new file mode 100644 index 00000000..14589077 Binary files /dev/null and b/viewport/gui_in_3d/screenshots/gui.png differ diff --git a/viewport/screen_capture/README.md b/viewport/screen_capture/README.md new file mode 100644 index 00000000..02b5488b --- /dev/null +++ b/viewport/screen_capture/README.md @@ -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) diff --git a/viewport/screen_capture/screenshots/.gdignore b/viewport/screen_capture/screenshots/.gdignore new file mode 100644 index 00000000..e69de29b diff --git a/viewport/screen_capture/screenshots/capture.png b/viewport/screen_capture/screenshots/capture.png new file mode 100644 index 00000000..15ea06c2 Binary files /dev/null and b/viewport/screen_capture/screenshots/capture.png differ diff --git a/visual_script/multitouch_view/README.md b/visual_script/multitouch_view/README.md index 0f44415c..cc94c2f6 100644 --- a/visual_script/multitouch_view/README.md +++ b/visual_script/multitouch_view/README.md @@ -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)