Created fps demo

This commit is contained in:
TinmanJuggernaut 2019-06-02 11:46:07 +09:00 committed by Cory Petkovsek
parent 377b30ae69
commit c29e2aaa7d
59 changed files with 1829 additions and 11 deletions

View File

@ -1,15 +1,92 @@
Voxel game demos (Godot Engine)
Game Demos for Voxel Tools for Godot
===============================
This project contains several scenes to test and demo the voxel module I'm developping for Godot Engine.
This project contains several demos to show off the different features of [Voxel Tools for Godot](https://github.com/Zylann/godot_voxel).
![Screenshot](screenshots/2016_04_27_2037_half.png)
Voxel Tools is a C++ module for the [Godot game engine](https://godotengine.org). Godot must be built from source with Voxel Tools compiled into it. An instruction guide is provided in the VT repository docs.
Dependencies
VT is still a work in progress and is not yet feature complete. These scenes are just demos to learn from. Most voxel related issues should be reported to the VT repository above.
Screenshots
---------------
<img src="screenshots/textured-terrain.jpg" width="800" />
<img src="screenshots/blocky-vertex-color.jpg" width="800" />
<img src="screenshots/3d-noise.jpg" width="800" />
<img src="screenshots/2016_04_27_2037_half.png" width="800" />
This project uses a C++ module:
- [Voxel](https://github.com/Zylann/godot_voxel)
For the old (unmaintained) pure-GDScript version, checkout the branch `full_gdscript`.
Available Demos
==================
Each demo is in a separate directory under the following names. Double click a scene, then press F6 to run it.
### fps_demo ###
Contributed by [Cory Petkovsek](https://github.com/tinmanjuggernaut/).
This demo has several example scenes. All have the following controls:
*Controls*
* W/A/S/D/Space - Move player, Jump
* Mouse wheel - Zoom between follow camera and first person
* Left mouse button - Shoot a bullet that adds terrain
* Right mouse button - Shoot a bullet that destroys terrain
* CTRL+mouse button - Shoot a bouncy ball that grows
*Demos*
1. **heightmap_smooth.tscn** - VoxelTerrain using the smooth Dual Marching Cubes (DMC) mesher, and a heightmap image as the data source.
1. **heightmap_blocky.tscn** - VoxelTerrain using the blocky mesher and a heightmap image as the data source. Textured with vertex-color.
1. **heightmap_smooth_lod.tscn** - VoxelLODTerrain using a heightmap image. Supports Levels Of Detail(LOD). Terrain is not yet editable.
1. **noise_smooth_lod.tscn** - VoxelLODTerrain using the smooth DMC mesher and OpenSimplexNoise as the data source. Supports Levels Of Detail(LOD). Terrain is not yet editable. Press 'N' to generate a new random terrain.
1. **custom_stream.tscn** - Generates a VoxelTerrain from code, and provides a data source from code. Read through CodeTerrain.gd to see what options you can turn on and off to try out the different types of terrains.
*Notes*
* The Player object exports a `Jump_is_jetpack` option in the Inspector to toggle jump/jetpack mode. It also exports walk and jump speeds.
* The camera does a pretty good job of detecting collisions and moving in closer to the player when you're inside a cave. Then it automatically pulls back after the camera_pullback_delay exported by the player. Use the wheel to override and keep the zoom in tighter.
* For older systems, you can increase performance with the following tips:
* Use grass-rock.material instead of grass-rock2.material (which has extra texture lookups and is significantly slower)
* Decrease shadow length to say 20 or 0. (World Environment scene, Directional Light)
* Also, you generally want to keep vsync off and multithreaded off, which both currently slow down updates to the terrain.
* Materials
* vertex-color.material - Plain white shader with `vertex_color_use_as_albedo` enabled. Use it on a blocky terrain to see the built in ambient occlusion.
* grass-rock and grass-rock2.material - These are shaders that allow for separate top and sides/bottom textures, each having triplanar mapped albedo, normal and AO maps. V2 also detiles the textures so when viewed from a distance you don't see the repeating pattern of a tiled texture. It is however a little more expensive.
* uv_checker.material - A numbered texture map for evaluating UVs.
### blocky_terrain ###
* main.tscn - VoxelTerrain with the blocky mesher, using a heightmap image for the source data.
* W/A/S/D/Space/Clicks/Wheel
* 1 - Shadows on/off
* 2 - Vsync on/off
* F3 - Show map of built chunks
### dmc_terrain ###
* main.tscn - VoxelTerrain with the smooth mesher, using a heightmap image for the source data.
* main_lod.tscn - VoxelLODTerrain with 3D noise for the source data.
* W/A/S/D/Space/Clicks/Wheel (same for both)
### dmc_test ###
* main.tscn - A basic demo of moving a voxel cube around, using the smooth DMC mesher.
* W/A/S/D/Space/Clicks/Wheel
* Arrows/page up/page down move the voxel cube
* Keypad +/- to adjust size
* Keypad 3/4 to rotate
Archived Demos
-----------------
### GDScript Only Implementation ###
* The old, unmaintained, GDScript-only version of Voxel Tools can be found in the `full_gdscript` branch.
### transvoxel_test ###
* transvoxel_test.tscn - An initial test demo for a mesher that uses the transvoxel isometric algorithm. The mesher is not complete in VT and this demo is broken. Don't use.

View File

@ -0,0 +1,21 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://fps_demo/support/platform.tscn" type="PackedScene" id=1]
[ext_resource path="res://fps_demo/support/WorldEnvironment.tscn" type="PackedScene" id=2]
[ext_resource path="res://fps_demo/support/UI.tscn" type="PackedScene" id=3]
[ext_resource path="res://fps_demo/support/player.tscn" type="PackedScene" id=4]
[ext_resource path="res://fps_demo/scripts/CodeTerrain.gd" type="Script" id=6]
[node name="Spatial" type="Spatial"]
script = ExtResource( 6 )
[node name="UI" parent="." instance=ExtResource( 3 )]
[node name="WorldEnvironment" parent="." instance=ExtResource( 2 )]
[node name="Platform" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 30, 0 )
[node name="Player" parent="." instance=ExtResource( 4 )]
transform = Transform( -0.766044, 0, -0.642788, 0, 1, 0, 0.642788, 0, -0.766044, 0, 32, 0 )
jump_is_jetpack = true

View File

@ -0,0 +1,47 @@
[gd_scene load_steps=11 format=2]
[ext_resource path="res://blocky_terrain/noise_distorted.png" type="Image" id=1]
[ext_resource path="res://fps_demo/support/UI.tscn" type="PackedScene" id=2]
[ext_resource path="res://fps_demo/support/WorldEnvironment.tscn" type="PackedScene" id=3]
[ext_resource path="res://fps_demo/support/player.tscn" type="PackedScene" id=4]
[ext_resource path="res://fps_demo/materials/vertex-color.material" type="Material" id=5]
[ext_resource path="res://fps_demo/support/platform.tscn" type="PackedScene" id=6]
[sub_resource type="VoxelStreamImage" id=1]
image = ExtResource( 1 )
[sub_resource type="Voxel" id=2]
transparent = true
[sub_resource type="Voxel" id=3]
geometry_type = 1
cube_geometry/padding_y = 0.0
cube_tiles/left = Vector2( 0, 0 )
cube_tiles/right = Vector2( 0, 0 )
cube_tiles/bottom = Vector2( 0, 0 )
cube_tiles/top = Vector2( 0, 0 )
cube_tiles/back = Vector2( 0, 0 )
cube_tiles/front = Vector2( 0, 0 )
[sub_resource type="VoxelLibrary" id=4]
voxels/0 = SubResource( 2 )
voxels/1 = SubResource( 3 )
[node name="Spatial" type="Spatial"]
[node name="UI" parent="." instance=ExtResource( 2 )]
[node name="WorldEnvironment" parent="." instance=ExtResource( 3 )]
[node name="Platform" parent="." instance=ExtResource( 6 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.1, 50.18, -5.25 )
[node name="Player" parent="." instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 52, -5 )
[node name="VoxelTerrain" type="VoxelTerrain" parent="."]
stream = SubResource( 1 )
voxel_library = SubResource( 4 )
view_distance = 256
viewer_path = NodePath("../Player")
material/0 = ExtResource( 5 )

View File

@ -0,0 +1,49 @@
[gd_scene load_steps=11 format=2]
[ext_resource path="res://blocky_terrain/noise_distorted.png" type="Image" id=1]
[ext_resource path="res://fps_demo/support/WorldEnvironment.tscn" type="PackedScene" id=2]
[ext_resource path="res://fps_demo/support/player.tscn" type="PackedScene" id=3]
[ext_resource path="res://fps_demo/support/platform.tscn" type="PackedScene" id=4]
[ext_resource path="res://fps_demo/support/UI.tscn" type="PackedScene" id=5]
[ext_resource path="res://fps_demo/materials/grass-rock.material" type="Material" id=6]
[sub_resource type="VoxelStreamImage" id=1]
image = ExtResource( 1 )
channel = 1
[sub_resource type="Voxel" id=2]
transparent = true
[sub_resource type="Voxel" id=3]
geometry_type = 1
cube_geometry/padding_y = 0.0
cube_tiles/left = Vector2( 0, 0 )
cube_tiles/right = Vector2( 0, 0 )
cube_tiles/bottom = Vector2( 0, 0 )
cube_tiles/top = Vector2( 0, 0 )
cube_tiles/back = Vector2( 0, 0 )
cube_tiles/front = Vector2( 0, 0 )
[sub_resource type="VoxelLibrary" id=4]
voxels/0 = SubResource( 2 )
voxels/1 = SubResource( 3 )
[node name="Spatial" type="Spatial"]
[node name="UI" parent="." instance=ExtResource( 5 )]
[node name="WorldEnvironment" parent="." instance=ExtResource( 2 )]
[node name="Platform" parent="." instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.1, 50.18, -5.25 )
[node name="Player" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 52, -5 )
[node name="VoxelTerrain" type="VoxelTerrain" parent="."]
stream = SubResource( 1 )
voxel_library = SubResource( 4 )
view_distance = 256
viewer_path = NodePath("../Player")
smooth_meshing_enabled = true
material/0 = ExtResource( 6 )

View File

@ -0,0 +1,77 @@
[gd_scene load_steps=16 format=2]
[ext_resource path="res://blocky_terrain/noise_distorted.png" type="Image" id=1]
[ext_resource path="res://fps_demo/support/platform.tscn" type="PackedScene" id=2]
[ext_resource path="res://fps_demo/support/player.tscn" type="PackedScene" id=3]
[ext_resource path="res://fps_demo/support/WorldEnvironment.tscn" type="PackedScene" id=4]
[ext_resource path="res://fps_demo/materials/grass-rock.material" type="Material" id=5]
[ext_resource path="res://fps_demo/support/UI.tscn" type="PackedScene" id=6]
[ext_resource path="res://fps_demo/materials/water.material" type="Material" id=8]
[ext_resource path="res://fps_demo/textures/Rock12_col.jpg" type="Texture" id=9]
[ext_resource path="res://fps_demo/textures/Rock12_nrm.jpg" type="Texture" id=10]
[ext_resource path="res://fps_demo/textures/Rock12_AO.jpg" type="Texture" id=11]
[sub_resource type="VoxelStreamImage" id=1]
image = ExtResource( 1 )
channel = 1
[sub_resource type="PlaneMesh" id=2]
material = ExtResource( 8 )
size = Vector2( 2048, 2048 )
[sub_resource type="SpatialMaterial" id=3]
albedo_color = Color( 0.772549, 0.772549, 0.772549, 1 )
albedo_texture = ExtResource( 9 )
roughness = 0.91
normal_enabled = true
normal_scale = 1.0
normal_texture = ExtResource( 10 )
ao_enabled = true
ao_light_affect = 1.0
ao_texture = ExtResource( 11 )
ao_on_uv2 = false
ao_texture_channel = 4
uv1_scale = Vector3( 100, 100, 1 )
[sub_resource type="PlaneMesh" id=4]
material = SubResource( 3 )
size = Vector2( 2048, 2048 )
[sub_resource type="BoxShape" id=5]
extents = Vector3( 2048, 0.01, 2048 )
[node name="Spatial" type="Spatial"]
[node name="UI" parent="." instance=ExtResource( 6 )]
[node name="WorldEnvironment" parent="." instance=ExtResource( 4 )]
[node name="Platform" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1170.85, 197.34, 888.8 )
[node name="Player" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1171, 202, 888 )
WALK_SPEED = 20.0
jump_is_jetpack = true
[node name="VoxelTerrain" type="VoxelLodTerrain" parent="."]
stream = SubResource( 1 )
view_distance = 2048
lod_count = 6
viewer_path = NodePath("../Player")
material = ExtResource( 5 )
[node name="Water" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1024, 10, 1024 )
mesh = SubResource( 2 )
material/0 = null
[node name="Ground Plane" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1024, 0, 1024 )
mesh = SubResource( 4 )
material/0 = null
[node name="StaticBody" type="StaticBody" parent="Ground Plane"]
[node name="CollisionShape" type="CollisionShape" parent="Ground Plane/StaticBody"]
shape = SubResource( 5 )

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,135 @@
/******************************************************
This shader blends two separate top and side textures, each with their own triplanar mapped albedo, normal and ambient occlusion.
Texture A is the top surface.
Texture B are the sides and bottom.
The typical use case would be to have grass on top and a rocky surface on the sides and bottom of a terrain.
This version of the shader shows an obvious repeating pattern when wide, flat areas are textured. This is inevitable when stamping
the same texture over and over. Version 2 of this shader fixes this issue at the cost of additional texture lookups.
Last modified: 2019-08-15
******************************************************/
shader_type spatial;
render_mode diffuse_burley;
uniform bool A_albedo_enabled = true;
uniform vec4 A_albedo_tint : hint_color = vec4(1., 1., 1., 1.);
uniform sampler2D A_albedo_map : hint_albedo;
uniform bool A_normal_enabled = true;
uniform sampler2D A_normal_map : hint_normal;
uniform float A_normal_strength : hint_range(-16., 16.0) = 1.;
uniform bool A_ao_enabled = true;
uniform float A_ao_strength : hint_range(-1., 1.0) = 1.;
uniform vec4 A_ao_texture_channel = vec4(1., 0., 0., 0.); // Use only one channel: Red, Green, Blue, Alpha
uniform sampler2D A_ao_map : hint_white;
uniform float A_tri_blend_sharpness : hint_range(0.001, 50.0) = 50.;
uniform int A_uv_tiles : hint_range(1, 16) = 1;
uniform vec3 A_uv_offset;
uniform bool B_albedo_enabled = true;
uniform vec4 B_albedo_tint : hint_color = vec4(1., 1., 1., 1.);
uniform sampler2D B_albedo_map : hint_albedo;
uniform bool B_normal_enabled = true;
uniform sampler2D B_normal_map : hint_normal;
uniform float B_normal_strength : hint_range(-16., 16.0) = 1.;
uniform bool B_ao_enabled = true;
uniform float B_ao_strength : hint_range(-1., 1.0) = 1.;
uniform vec4 B_ao_texture_channel = vec4(1., 0., 0., 0.); // Use only one channel: Red, Green, Blue, Alpha
uniform sampler2D B_ao_map : hint_white;
uniform float B_tri_blend_sharpness : hint_range(0.001, 50.0) = 50.;
uniform int B_uv_tiles : hint_range(1, 16) = 1;
uniform vec3 B_uv_offset;
uniform float AB_mix1 : hint_range(-10., 0.) = -6.;
uniform float AB_mix2 : hint_range(-50., 50.) = -10.;
varying vec3 A_uv_triplanar_pos;
varying vec3 A_uv_power_normal;
varying vec3 B_uv_triplanar_pos;
varying vec3 B_uv_power_normal;
varying vec3 v_world_normal;
void vertex() {
TANGENT = vec3(0.0,0.0,-1.0) * abs(NORMAL.x);
TANGENT+= vec3(1.0,0.0,0.0) * abs(NORMAL.y);
TANGENT+= vec3(1.0,0.0,0.0) * abs(NORMAL.z);
TANGENT = normalize(TANGENT);
BINORMAL = vec3(0.0,1.0,0.0) * abs(NORMAL.x);
BINORMAL+= vec3(0.0,0.0,-1.0) * abs(NORMAL.y);
BINORMAL+= vec3(0.0,1.0,0.0) * abs(NORMAL.z);
BINORMAL = normalize(BINORMAL);
A_uv_power_normal=pow(abs(NORMAL),vec3(A_tri_blend_sharpness));
A_uv_power_normal/=dot(A_uv_power_normal,vec3(1.0));
A_uv_triplanar_pos = VERTEX * float(A_uv_tiles) / (16.) + A_uv_offset; //On VoxelTerrain 16 is 100% size, so uv_tile is multiples of 16.
A_uv_triplanar_pos *= vec3(1.0,-1.0, 1.0);
B_uv_power_normal=pow(abs(NORMAL),vec3(B_tri_blend_sharpness));
B_uv_power_normal/=dot(B_uv_power_normal,vec3(1.0));
B_uv_triplanar_pos = VERTEX * float(B_uv_tiles) / (16.) + B_uv_offset;
B_uv_triplanar_pos *= vec3(1.0,-1.0, 1.0);
v_world_normal = NORMAL;
}
vec4 triplanar_texture(sampler2D p_sampler, vec3 p_weights, vec3 p_triplanar_pos) {
vec4 samp=vec4(0.0);
samp+= texture(p_sampler,p_triplanar_pos.xy) * p_weights.z;
samp+= texture(p_sampler,p_triplanar_pos.xz) * p_weights.y;
samp+= texture(p_sampler,p_triplanar_pos.zy * vec2(-1.0,1.0)) * p_weights.x;
return samp;
}
void fragment() {
// Get normal used for mixing top A and sides B
vec3 normal = normalize(v_world_normal);
// Calculate Albedo
vec3 A_albedo, B_albedo;
if(A_albedo_enabled) {
ALBEDO = A_albedo = A_albedo_tint.rgb * triplanar_texture(A_albedo_map,A_uv_power_normal,A_uv_triplanar_pos).rgb;
}
if(B_albedo_enabled) {
ALBEDO = B_albedo = B_albedo_tint.rgb * triplanar_texture(B_albedo_map,B_uv_power_normal,B_uv_triplanar_pos).rgb;
}
if(A_albedo_enabled==true && B_albedo_enabled==true) {
ALBEDO = mix(B_albedo, A_albedo, clamp(AB_mix1 + 10.*normal.y + AB_mix2*A_albedo.b , 0., 1.));
}
// Calculate Ambient Occlusion
float A_ao=1., B_ao=1.;
if(A_ao_enabled)
AO = A_ao = dot(triplanar_texture(A_ao_map,A_uv_power_normal,A_uv_triplanar_pos),A_ao_texture_channel);
if(B_ao_enabled)
AO = B_ao = dot(triplanar_texture(B_ao_map,B_uv_power_normal,B_uv_triplanar_pos),B_ao_texture_channel);
if(A_ao_enabled || B_ao_enabled) {
AO = mix(B_ao, A_ao, clamp(AB_mix1 + 10.*normal.y + AB_mix2*A_albedo.b , 0., 1.));
AO_LIGHT_AFFECT = mix(B_ao_strength, A_ao_strength, clamp(AB_mix1 + 10.*normal.y + AB_mix2*A_albedo.b , 0., 1.));
}
// Calculate Normals
vec3 A_normal=vec3(0.5,0.5, 0.5);
vec3 B_normal=vec3(0.5,0.5,0.5);
if(A_normal_enabled)
A_normal = triplanar_texture(A_normal_map,A_uv_power_normal,A_uv_triplanar_pos).rgb;
if(B_normal_enabled)
B_normal = triplanar_texture(B_normal_map,B_uv_power_normal,B_uv_triplanar_pos).rgb;
if(A_normal_enabled || B_normal_enabled) {
NORMALMAP = mix(B_normal, A_normal, clamp(AB_mix1 + 10.*normal.y + AB_mix2*A_albedo.b , 0., 1.));
NORMALMAP_DEPTH = mix(B_normal_strength, A_normal_strength, clamp(AB_mix1 + 10.*normal.y + AB_mix2*A_albedo.b , 0., 1.));
}
}

View File

@ -0,0 +1,166 @@
/******************************************************
This shader blends two separate top and side textures, each with their own triplanar mapped albedo, normal and ambient occlusion.
Texture A is the top surface.
Texture B are the sides and bottom.
The typical use case would be to have grass on top and a rocky surface on the sides and bottom of a terrain.
This version (v2) adds an untiled texture lookup which hides the repeating pattern that appears when stamping the same texture over
and over. However it costs two additional texture lookups. At lower resolutions the performance cost is marginal, but at 4k the
frame rate cuts in half.
Last modified: 2019-08-15
******************************************************/
shader_type spatial;
render_mode diffuse_burley,world_vertex_coords;
uniform bool A_albedo_enabled = true;
uniform vec4 A_albedo_tint : hint_color = vec4(1., 1., 1., 1.);
uniform sampler2D A_albedo_map : hint_albedo;
uniform bool A_normal_enabled = true;
uniform sampler2D A_normal_map : hint_normal;
uniform float A_normal_strength : hint_range(-16., 16.0) = 1.;
uniform bool A_ao_enabled = true;
uniform float A_ao_strength : hint_range(-1., 1.0) = 1.;
uniform vec4 A_ao_texture_channel = vec4(1., 0., 0., 0.); // Use only use one channel: Red, Green, Blue, Alpha
uniform sampler2D A_ao_map : hint_white;
uniform float A_tri_blend_sharpness : hint_range(0.001, 50.0) = 50.;
uniform float A_uv_scale : hint_range(0.01, .4) = .25;
uniform vec3 A_uv_offset;
uniform bool B_albedo_enabled = true;
uniform vec4 B_albedo_tint : hint_color = vec4(1., 1., 1., 1.);
uniform sampler2D B_albedo_map : hint_albedo;
uniform bool B_normal_enabled = true;
uniform sampler2D B_normal_map : hint_normal;
uniform float B_normal_strength : hint_range(-16., 16.0) = 1.;
uniform bool B_ao_enabled = true;
uniform float B_ao_strength : hint_range(-1., 1.0) = 1.;
uniform vec4 B_ao_texture_channel = vec4(1., 0., 0., 0.); // Use only one channel: Red, Green, Blue, Alpha
uniform sampler2D B_ao_map : hint_white;
uniform float B_tri_blend_sharpness : hint_range(0.001, 50.0) = 50.;
uniform float B_uv_scale : hint_range(0.01, .4) = 0.0625;
uniform vec3 B_uv_offset;
uniform float AB_mix1 : hint_range(-10., 0.) = -6.;
uniform float AB_mix2 : hint_range(-50., 50.) = -10.;
varying vec3 A_uv_triplanar_pos;
varying vec3 A_uv_power_normal;
varying vec3 B_uv_triplanar_pos;
varying vec3 B_uv_power_normal;
varying vec3 v_world_normal;
void vertex() {
TANGENT = vec3(0.0,0.0,-1.0) * abs(NORMAL.x);
TANGENT+= vec3(1.0,0.0,0.0) * abs(NORMAL.y);
TANGENT+= vec3(1.0,0.0,0.0) * abs(NORMAL.z);
TANGENT = normalize(TANGENT);
BINORMAL = vec3(0.0,1.0,0.0) * abs(NORMAL.x);
BINORMAL+= vec3(0.0,0.0,-1.0) * abs(NORMAL.y);
BINORMAL+= vec3(0.0,1.0,0.0) * abs(NORMAL.z);
BINORMAL = normalize(BINORMAL);
A_uv_power_normal=pow(abs(NORMAL),vec3(A_tri_blend_sharpness));
A_uv_power_normal/=dot(A_uv_power_normal,vec3(1.0));
A_uv_triplanar_pos = VERTEX * A_uv_scale + A_uv_offset;
A_uv_triplanar_pos *= vec3(1.0,-1.0, 1.0);
B_uv_power_normal=pow(abs(NORMAL),vec3(B_tri_blend_sharpness));
B_uv_power_normal/=dot(B_uv_power_normal,vec3(1.0));
B_uv_triplanar_pos = VERTEX * B_uv_scale + B_uv_offset;
B_uv_triplanar_pos *= vec3(1.0,-1.0, 1.0);
v_world_normal = NORMAL;
}
// This untiles textures with only two sample lookups
// http://www.iquilezles.org/www/articles/texturerepetition/texturerepetition.htm
uniform sampler2D noise_texture : hint_white;
float sum( vec4 v ) { return v.x+v.y+v.z; }
vec4 untiled_texture(sampler2D samp, in vec2 uv) {
// sample variation pattern
float k = texture( noise_texture, 0.005*uv ).x; // cheap (cache friendly) lookup
// compute index
float index = k*8.0;
float i = floor( index );
float f = fract( index );
// offsets for the different virtual patterns
vec2 offa = sin(vec2(3.0,7.0)*(i+0.0)); // can replace with any other hash
vec2 offb = sin(vec2(3.0,7.0)*(i+1.0)); // can replace with any other hash
// compute derivatives for mip-mapping
vec2 dx = dFdx(uv);
vec2 dy = dFdy(uv);
// sample the two closest virtual patterns
vec4 cola = textureGrad( samp, uv + offa, dx, dy );
vec4 colb = textureGrad( samp, uv + offb, dx, dy );
// interpolate between the two virtual patterns
return mix( cola, colb, smoothstep(0.2,0.8,f-0.1*sum(cola-colb)) );
}
vec4 triplanar_texture(sampler2D p_sampler, vec3 p_weights, vec3 p_triplanar_pos) {
vec4 samp=vec4(0.0);
samp+= untiled_texture(p_sampler,p_triplanar_pos.xy) * p_weights.z;
samp+= untiled_texture(p_sampler,p_triplanar_pos.xz) * p_weights.y;
samp+= untiled_texture(p_sampler,p_triplanar_pos.zy * vec2(-1.0,1.0)) * p_weights.x;
return samp;
}
void fragment() {
// Get normal used for mixing top A and sides B
vec3 normal = normalize(v_world_normal);
// Calculate Albedo
vec3 A_albedo, B_albedo;
if(A_albedo_enabled) {
ALBEDO = A_albedo = A_albedo_tint.rgb * triplanar_texture(A_albedo_map,A_uv_power_normal,A_uv_triplanar_pos).rgb;
}
if(B_albedo_enabled) {
ALBEDO = B_albedo = B_albedo_tint.rgb * triplanar_texture(B_albedo_map,B_uv_power_normal,B_uv_triplanar_pos).rgb;
}
if(A_albedo_enabled==true && B_albedo_enabled==true) {
ALBEDO = mix(B_albedo, A_albedo, clamp(AB_mix1 + 10.*normal.y + AB_mix2*A_albedo.b , 0., 1.));
}
// Calculate Ambient Occlusion
float A_ao=1., B_ao=1.;
if(A_ao_enabled)
AO = A_ao = dot(triplanar_texture(A_ao_map,A_uv_power_normal,A_uv_triplanar_pos),A_ao_texture_channel);
if(B_ao_enabled)
AO = B_ao = dot(triplanar_texture(B_ao_map,B_uv_power_normal,B_uv_triplanar_pos),B_ao_texture_channel);
if(A_ao_enabled || B_ao_enabled) {
AO = mix(B_ao, A_ao, clamp(AB_mix1 + 10.*normal.y + AB_mix2*A_albedo.b , 0., 1.));
AO_LIGHT_AFFECT = mix(B_ao_strength, A_ao_strength, clamp(AB_mix1 + 10.*normal.y + AB_mix2*A_albedo.b , 0., 1.));
}
// Calculate Normals
vec3 A_normal=vec3(0.5,0.5, 0.5);
vec3 B_normal=vec3(0.5,0.5,0.5);
if(A_normal_enabled)
A_normal = triplanar_texture(A_normal_map,A_uv_power_normal,A_uv_triplanar_pos).rgb;
if(B_normal_enabled)
B_normal = triplanar_texture(B_normal_map,B_uv_power_normal,B_uv_triplanar_pos).rgb;
if(A_normal_enabled || B_normal_enabled) {
NORMALMAP = mix(B_normal, A_normal, clamp(AB_mix1 + 10.*normal.y + AB_mix2*A_albedo.b , 0., 1.));
NORMALMAP_DEPTH = mix(B_normal_strength, A_normal_strength, clamp(AB_mix1 + 10.*normal.y + AB_mix2*A_albedo.b , 0., 1.));
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,72 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://fps_demo/support/platform.tscn" type="PackedScene" id=1]
[ext_resource path="res://fps_demo/support/player.tscn" type="PackedScene" id=2]
[ext_resource path="res://fps_demo/support/WorldEnvironment.tscn" type="PackedScene" id=3]
[ext_resource path="res://fps_demo/support/UI.tscn" type="PackedScene" id=4]
[ext_resource path="res://fps_demo/materials/grass-rock.material" type="Material" id=5]
[ext_resource path="res://fps_demo/scripts/NoiseWorld.gd" type="Script" id=6]
[sub_resource type="OpenSimplexNoise" id=1]
[sub_resource type="VoxelStreamNoise" id=2]
noise = SubResource( 1 )
[node name="Spatial" type="Spatial"]
script = ExtResource( 6 )
[node name="UI_Noise" type="VBoxContainer" parent="."]
margin_top = 37.0
margin_right = 40.0
margin_bottom = 123.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Seed" type="Label" parent="UI_Noise"]
margin_right = 40.0
margin_bottom = 14.0
text = "Seed: "
[node name="Octaves" type="Label" parent="UI_Noise"]
margin_top = 18.0
margin_right = 40.0
margin_bottom = 32.0
text = "Seed: "
[node name="Period" type="Label" parent="UI_Noise"]
margin_top = 36.0
margin_right = 40.0
margin_bottom = 50.0
text = "Seed: "
[node name="Persistence" type="Label" parent="UI_Noise"]
margin_top = 54.0
margin_right = 40.0
margin_bottom = 68.0
text = "Seed: "
[node name="Lacunarity" type="Label" parent="UI_Noise"]
margin_top = 72.0
margin_right = 40.0
margin_bottom = 86.0
text = "Seed: "
[node name="UI" parent="." instance=ExtResource( 4 )]
[node name="WorldEnvironment" parent="." instance=ExtResource( 3 )]
[node name="Platform" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1170.85, 197.34, 888.8 )
[node name="Player" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1171, 202, 888 )
WALK_SPEED = 40.0
jump_is_jetpack = true
[node name="VoxelTerrain" type="VoxelLodTerrain" parent="."]
stream = SubResource( 2 )
view_distance = 2048
lod_count = 6
viewer_path = NodePath("../Player")
material = ExtResource( 5 )

View File

@ -0,0 +1,86 @@
extends RigidBody
signal painting
enum BULLET_TYPE {
BALL = -1, # Bouncy ball
ADD = 0, # Add terrain
DELETE = 1 # Delete terrain
}
var terrain
var type = BULLET_TYPE.BALL
var GROWTH_SPEED:Vector3 = Vector3(0.01,0.01,0.01)
var EDIT_SIZE:float = 4
var MIN_DISTANCE:float = 2
var LIFE_TIME:int = 60
var growth_ticker:int = 0
var sound_played:bool = false
func _ready():
if(type != BULLET_TYPE.BALL):
terrain = get_node("../VoxelTerrain")
bounce = 2.0
# Enable bullet collision detection
contact_monitor = true
contacts_reported = 1
connect("body_entered", self, "_on_bullet_hit")
var mat = SpatialMaterial.new()
if(type == BULLET_TYPE.ADD):
mat.albedo_color = Color(1,1,1,1)
elif type == BULLET_TYPE.DELETE:
mat.albedo_color = Color(0,0,0,1)
else:
mat.albedo_color = Color( rand_range(0,1), rand_range(0,1), rand_range(0,1), 1 )
$Mesh.set_surface_material(0, mat)
var death_timer = Timer.new()
add_child(death_timer)
death_timer.connect("timeout", self, "_on_life_timeout")
death_timer.start(LIFE_TIME)
func _on_bullet_hit(body):
if not sound_played and body.name != "Player":
$AudioStreamPlayer3D.play()
sound_played = true
if type == BULLET_TYPE.BALL and OS.get_ticks_msec() - growth_ticker > 100:
scale += GROWTH_SPEED
mass += GROWTH_SPEED.x
growth_ticker = OS.get_ticks_msec()
if body.name == "VoxelTerrain" and type != BULLET_TYPE.BALL:
paint_sphere(global_transform.origin, EDIT_SIZE, type)
queue_free()
func _on_life_timeout():
queue_free()
func paint_sphere(center, fradius, type):
# Creates a new VoxelTool each call, so if you want to retain data, put it in a global function (not in Bullet since it gets destroyed)
var vt = terrain.get_voxel_tool()
# Return if trying to add a block within MIN_DISTANCE of the player
if type == BULLET_TYPE.ADD and (center - $"../Player".global_transform.origin).length() <= fradius+MIN_DISTANCE:
return
if "smooth_meshing_enabled" in terrain and terrain.smooth_meshing_enabled:
vt.channel = VoxelBuffer.CHANNEL_ISOLEVEL
if(type == BULLET_TYPE.ADD):
vt.mode = VoxelTool.MODE_ADD
vt.value = 1
elif(type == BULLET_TYPE.DELETE):
vt.mode = VoxelTool.MODE_REMOVE
vt.value = 0
vt.do_sphere(global_transform.origin, fradius)

View File

@ -0,0 +1,93 @@
""" This file shows you how to create a Voxel Tools terrain from code """
extends Spatial
const MyStream = preload ("MyStream.gd")
const MATERIAL = preload("res://fps_demo/materials/grass-rock.material")
const HEIGHT_MAP = preload("res://blocky_terrain/noise_distorted.png")
var terrain
func _ready():
create_terrain()
func _input(event):
if event is InputEventKey and Input.is_key_pressed(KEY_DELETE):
terrain.free()
if event is InputEventKey and Input.is_key_pressed(KEY_N):
create_terrain()
func create_terrain():
### Folllow the instructions to use the various types of terrains available
### 1. Choose VoxelTerrain or VoxelLodTerrain
terrain = VoxelTerrain.new()
# terrain = VoxelLodTerrain.new()
### 2. Select Blocky=0 or Smooth=1 (VLT is always smooth)
var voxel_type = 1
### 3. Pick one of the following three example sections:
## A. Custom GDScript stream
## This generates a 3D sine wave with GDScript
terrain.stream = MyStream.new()
terrain.stream.voxel_type = voxel_type
## B. C++ Stream (VT Only)
## This generates a 3D sine wave from C++ and is considerably faster.
## This example is hard coded to draw blocky voxels so doesn't work with VLT, but you could write your own in C++.
# terrain.stream = VoxelStreamTest.new()
## C. Image based stream
# terrain.stream = VoxelStreamImage.new()
# terrain.stream.image = HEIGHT_MAP
# terrain.stream.channel = voxel_type
# $Player.translate(Vector3(0,35,0)) # Not required, just aids the demo
## D. 3D Noise stream (Smooth only)
# terrain.stream = VoxelStreamNoise.new()
# terrain.stream.noise = OpenSimplexNoise.new()
# $Player.translate(Vector3(0,200,0)) # Not required, just aids the demo
### 4. Uncomment the one appropriate block below
## VoxelTerrain
terrain.voxel_library = VoxelLibrary.new()
if voxel_type==1:
terrain.smooth_meshing_enabled = true
terrain.view_distance = 256
terrain.set_material(0, MATERIAL)
## VoxelLodTerrain
# terrain.lod_count = 8
# terrain.lod_split_scale = 3
# terrain.set_material(MATERIAL)
### 5. Stop - Applicable to all
terrain.viewer_path = "/root/Spatial/Player"
terrain.name = "VoxelTerrain"
add_child(terrain)

View File

@ -0,0 +1,32 @@
extends VoxelStream
var voxel_type:int = 1 # 0 Blocky / 1 Smooth
var amplitude:float = 10.0
var period:Vector2 = Vector2(1/10.0, 1/10.0)
func emerge_block(out_buffer:VoxelBuffer, origin:Vector3, lod:int):
# Draw on LOD 0
if lod != 0:
return
# Draw a flat plane at origin.y == 0
# if origin.y < 0:
# out_buffer.fill(1, voxel_type)
# return
# Draw 3D sine waves
var size = out_buffer.get_size()
for rz in range(0, size.z):
for rx in range(0, size.x):
var x:float = origin.x + rx
var z:float = origin.z + rz
var h:int = amplitude * (cos(x * period.x) + sin(z * period.y)) # Y is correct
var rh:int = h - origin.y
if rh > size.y:
rh = size.y
for ry in range(0, rh):
out_buffer.set_voxel(1, rx, ry, rz, voxel_type);

View File

@ -0,0 +1,46 @@
extends Spatial
onready var terrain = $VoxelTerrain
const MATERIAL = preload("res://fps_demo/materials/grass-rock2.material")
func _ready():
randomize()
update_noise_ui()
func _input(event):
if event is InputEventKey and Input.is_key_pressed(KEY_N):
randomize_terrain()
if event is InputEventKey and Input.is_key_pressed(KEY_TAB):
$UI_Noise.visible = !$UI_Noise.visible
$UI.visible = !$UI.visible
func randomize_terrain():
terrain.queue_free()
terrain = VoxelLodTerrain.new()
terrain.name = "VoxelTerrain"
terrain.stream = VoxelStreamNoise.new()
terrain.stream.noise = OpenSimplexNoise.new()
terrain.stream.noise.seed = randi() # Int (0): 0 to 2147483647
terrain.stream.noise.octaves = 1+randi()%5 # Int (3): 1 - 6
terrain.stream.noise.period = rand_range(0.1, 256) # Float (64): 0.1 - 256.0
terrain.stream.noise.persistence = randf() # Float (0.5): 0.0 - 1.0
terrain.stream.noise.lacunarity = rand_range(0.1, 4) # Float (2): 0.1 - 4.0
update_noise_ui()
terrain.lod_count = 8
terrain.lod_split_scale = 3
terrain.viewer_path = "/root/Spatial/Player"
terrain.set_material(MATERIAL)
add_child(terrain)
func update_noise_ui():
$UI_Noise/Seed.text = "Seed: " + String(terrain.stream.noise.seed)
$UI_Noise/Octaves.text = "Octaves: " + String(terrain.stream.noise.octaves)
$UI_Noise/Period.text = "Period: " + String(terrain.stream.noise.period).substr(0,4)
$UI_Noise/Persistence.text = "Persistence: " + String(terrain.stream.noise.persistence).substr(0,4)
$UI_Noise/Lacunarity.text = "Lacunarity: " + String(terrain.stream.noise.lacunarity).substr(0,4)

View File

@ -0,0 +1,197 @@
extends KinematicBody
const MOUSE_SENSITIVITY:float = 0.1
const GRAVITY:float = -9.8
const ACCEL:float = 8.0
const DEACCEL:float = 16.0
onready var MAX_FLOOR_ANGLE:float = deg2rad(60)
export var WALK_SPEED:float = 12.0
export var JUMP_SPEED:float = 15.0
export var jump_is_jetpack:bool = false
var velocity:Vector3 = Vector3() # Current velocity direction
const Bullet = preload("Bullet.gd")
var firing:bool = false
var firing_type = Bullet.BULLET_TYPE.BALL
onready var firing_tick:int = OS.get_ticks_msec()
export var FIRING_DELAY = 150
onready var camera_pullback_tick:int = OS.get_ticks_msec() # Pullback Timer
export var CAMERA_PULLBACK_DELAY = 1000 # Wait this many ms before pulling back
export var CAMERA_POS_CLOSE:Vector3 = Vector3(0, 0.3, 0) # Vectors that the two settings below lerp between
export var CAMERA_POS_FAR:Vector3 = Vector3(0, 3.5, 7)
var camera_max_lerp:float = 1.0 # User set max lerp position between 0 and 1
var camera_pos_lerp:float = 0.0 # Current lerp position between 0 and camera_max_lerp
func _ready():
randomize()
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _physics_process(delta):
#### Update Player
var direction = Vector3() # Where does the player want to move
var facing_direction = global_transform.basis # Get camera facing direction
if Input.is_action_pressed("move_forward"): # Fix: Can move around in the air, no momentum, so can also climb steep walls.
direction -= facing_direction.z
if Input.is_action_pressed("move_backward"):
direction += facing_direction.z
if Input.is_action_pressed("move_left"):
direction += -facing_direction.x
if Input.is_action_pressed("move_right"):
direction += +facing_direction.x
if Input.is_action_pressed("jump") and (jump_is_jetpack or is_on_floor()):
velocity.y = JUMP_SPEED
#direction.y = 0
direction = direction.normalized()
# Apply gravity to downward velocity
velocity.y += delta*GRAVITY
var hvelocity = velocity # Apply desired direction to horizontal velocity
hvelocity.y = 0
var target = direction*WALK_SPEED
var accel
if (direction.dot(hvelocity) > 0):
accel = ACCEL
else:
accel = DEACCEL
hvelocity = hvelocity.linear_interpolate(target, accel*delta)
velocity.x = hvelocity.x
velocity.z = hvelocity.z
velocity = move_and_slide(velocity, Vector3(0, 1, 0), true)
#### Continuous fire
if firing and OS.get_ticks_msec()-firing_tick>FIRING_DELAY:
firing_tick = OS.get_ticks_msec()
shoot_bullet()
#### Update Camera
if camera_max_lerp>0:
check_camera_bounds()
#### Update HUD
$"../UI/VBox/FPS".text = "FPS: " + String(Engine.get_frames_per_second())
$"../UI/VBox/Position".text = "Position: " + String(global_transform.origin)
# If follow camera is on, and hits the terrain, pull it in closer to the player
func check_camera_bounds():
var space_state = get_world().direct_space_state
var pos = $CamNode/Camera.global_transform.origin
# Raycast two unit around camera for rudimentary collision detection. (Maybe switch Camera parent to physicsbody?)
var result0 = space_state.intersect_ray(pos, pos + 2*$CamNode/Camera.global_transform.basis.z, [self]) # Behind
var result1 = space_state.intersect_ray(pos, pos - 2*$CamNode/Camera.global_transform.basis.z, [self]) # Front
var result2 = space_state.intersect_ray(pos, pos + 2*$CamNode/Camera.global_transform.basis.x, [self]) # Right
var result3 = space_state.intersect_ray(pos, pos - 2*$CamNode/Camera.global_transform.basis.x, [self]) # Left
var result4 = space_state.intersect_ray(pos, pos + 2*$CamNode/Camera.global_transform.basis.y, [self]) # Above
var result5 = space_state.intersect_ray(pos, pos - 2*$CamNode/Camera.global_transform.basis.y, [self]) # Below
if result0 or result1 or result2 or result3 or result4 or result5:
camera_pos_lerp -= .025
camera_pos_lerp = clamp(camera_pos_lerp, 0, camera_max_lerp)
camera_pullback_tick = OS.get_ticks_msec()
move_camera(camera_pos_lerp)
else:
if OS.get_ticks_msec() - camera_pullback_tick > CAMERA_PULLBACK_DELAY:
camera_pos_lerp += .01
camera_pos_lerp = clamp(camera_pos_lerp, 0, camera_max_lerp)
move_camera(camera_pos_lerp)
func move_camera(lerp_val:float) -> void:
var t = $CamNode/Camera.get_transform()
var offset = CAMERA_POS_CLOSE.linear_interpolate(CAMERA_POS_FAR, lerp_val)
t.origin = CAMERA_POS_CLOSE + offset
$CamNode/Camera.set_transform(t)
func shoot_bullet():
$AudioStreamPlayer.play()
var bullet = preload("res://fps_demo/support/bullet.tscn").instance()
var start_pos = $Body/Shoulder/Gun.global_transform.translated(Vector3(0,-1.15,0))
bullet.set_transform(start_pos)
bullet.scale = Vector3(.3,.3,.3)
if Input.is_key_pressed(KEY_CONTROL):
bullet.type = Bullet.BULLET_TYPE.BALL
else:
bullet.type = firing_type
bullet.set_linear_velocity(velocity - $Body/Shoulder/Gun.global_transform.basis.y * 30)
bullet.connect("painting", self, "_on_terrain_addition")
get_parent().add_child(bullet)
func _input(event):
if event is InputEventMouseButton and Input.is_mouse_button_pressed(BUTTON_WHEEL_UP):
camera_max_lerp -= .1
camera_max_lerp = clamp(camera_max_lerp, 0, 1)
if event is InputEventMouseButton and Input.is_mouse_button_pressed(BUTTON_WHEEL_DOWN):
camera_max_lerp += .1
camera_max_lerp = clamp(camera_max_lerp, 0, 1)
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
# Rotate the camera around the player vertically
$CamNode.rotate_x(deg2rad(-event.relative.y * MOUSE_SENSITIVITY * 0.90625))
var rot = $CamNode.rotation_degrees
rot.x = clamp(rot.x, -60, 85)
$CamNode.rotation_degrees = rot
# Rotate the gun up and down aligned with the player
$Body/Shoulder.rotate_x(deg2rad(-event.relative.y * MOUSE_SENSITIVITY))
rot = $Body/Shoulder.rotation_degrees
rot.x = clamp(rot.x, -80, 80)
$Body/Shoulder.rotation_degrees = rot
$GunCollisionShape.global_transform = $Body/Shoulder/Gun.global_transform
# Rotate Player left and right
self.rotate_y(deg2rad(event.relative.x * MOUSE_SENSITIVITY * -1))
if event is InputEventKey and Input.is_action_pressed("ui_cancel"):
if Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
else:
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
if event is InputEventMouseButton:
if Input.is_action_pressed("shoot_add"):
firing_type = Bullet.BULLET_TYPE.ADD
firing = true
firing_tick = OS.get_ticks_msec()
shoot_bullet()
elif Input.is_action_pressed("shoot_del"):
firing_type = Bullet.BULLET_TYPE.DELETE
firing = true
firing_tick = OS.get_ticks_msec()
shoot_bullet()
elif Input.is_action_just_released("shoot_add") or Input.is_action_just_released("shoot_del"):
firing = false

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/13283__schademans__pipe2.wav-0c140367031c185d6c3bd9fd65707a7a.sample"
[deps]
source_file="res://fps_demo/support/13283__schademans__pipe2.wav"
dest_files=[ "res://.import/13283__schademans__pipe2.wav-0c140367031c185d6c3bd9fd65707a7a.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/423778__someonecool15__rubber-ball-bouncing.wav-bdb3de5a56a65aed9480e3007c77b67b.sample"
[deps]
source_file="res://fps_demo/support/423778__someonecool15__rubber-ball-bouncing.wav"
dest_files=[ "res://.import/423778__someonecool15__rubber-ball-bouncing.wav-bdb3de5a56a65aed9480e3007c77b67b.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

View File

@ -0,0 +1,18 @@
## Rock
* License: CC0
* https://cc0textures.com/view.php?tex=Rock12
## Grass 01
* License: CC0
* https://www.deviantart.com/linolafett/art/Grass-01-434853879
## 13283__schademans__pipe2.wav
* License: Public domain
* https://freesound.org/people/schademans/sounds/13283/
423778__someonecool15__rubber-ball-bouncing.mp3* License: CC0
* License: CC0
* https://freesound.org/people/SomeoneCool15/sounds/423778/

View File

@ -0,0 +1,32 @@
[gd_scene format=2]
[node name="UI" type="Control"]
margin_right = 40.0
margin_bottom = 40.0
__meta__ = {
"_edit_use_anchors_": true
}
[node name="VBox" type="VBoxContainer" parent="."]
margin_right = 64.0
margin_bottom = 49.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="FPS" type="Label" parent="VBox"]
margin_right = 64.0
margin_bottom = 14.0
text = "FPS: "
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Position" type="Label" parent="VBox"]
margin_top = 18.0
margin_right = 64.0
margin_bottom = 32.0
text = "Position:: "
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,13 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://fps_demo/support/procedural_environment_fog.tres" type="Environment" id=1]
[node name="WorldEnvironment" type="WorldEnvironment"]
environment = ExtResource( 1 )
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 0.74221, 0.398819, -0.53858, 0, 0.803649, 0.595104, 0.670168, -0.441692, 0.596476, 0, 0, 0 )
light_energy = 1.5
shadow_enabled = true
shadow_color = Color( 0.537255, 0.537255, 0.537255, 1 )
directional_shadow_blend_splits = true

View File

@ -0,0 +1,22 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://fps_demo/scripts/Bullet.gd" type="Script" id=1]
[ext_resource path="res://fps_demo/support/423778__someonecool15__rubber-ball-bouncing.wav" type="AudioStream" id=2]
[sub_resource type="SphereMesh" id=1]
[sub_resource type="SphereShape" id=2]
[node name="Bullet" type="RigidBody"]
script = ExtResource( 1 )
[node name="Mesh" type="MeshInstance" parent="."]
mesh = SubResource( 1 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="."]
shape = SubResource( 2 )
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource( 2 )
unit_db = 9.0

View File

@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://fps_demo/materials/copper.material" type="Material" id=4]
[sub_resource type="CubeMesh" id=3]
material = ExtResource( 4 )
size = Vector3( 5, 0.5, 5 )
[sub_resource type="BoxShape" id=2]
extents = Vector3( 2.5, 0.25, 2.5 )
[node name="Platform" type="MeshInstance"]
mesh = SubResource( 3 )
material/0 = null
[node name="StaticBody" type="StaticBody" parent="."]
[node name="CollisionShape" type="CollisionShape" parent="StaticBody"]
shape = SubResource( 2 )

View File

@ -0,0 +1,67 @@
[gd_scene load_steps=11 format=2]
[ext_resource path="res://fps_demo/scripts/Player.gd" type="Script" id=1]
[ext_resource path="res://fps_demo/materials/gun-metal.material" type="Material" id=2]
[ext_resource path="res://fps_demo/materials/player.material" type="Material" id=3]
[ext_resource path="res://fps_demo/support/13283__schademans__pipe2.wav" type="AudioStream" id=4]
[sub_resource type="CubeMesh" id=1]
size = Vector3( 1, 2, 0.4 )
[sub_resource type="SphereMesh" id=3]
radius = 0.25
height = 0.5
[sub_resource type="CylinderMesh" id=2]
[sub_resource type="RayShape" id=8]
length = 2.0
[sub_resource type="CapsuleShape" id=9]
radius = 0.680461
height = 0.505174
[sub_resource type="ConvexPolygonShape" id=6]
points = PoolVector3Array( -0.982432, -0.982623, -0.184098, -0.982432, -0.982623, 0.184098, -0.982432, 0.982623, -0.184098, -0.982432, 0.982623, 0.184098, -0.951084, -0.981837, -0.306584, -0.951084, 0.981837, 0.306584, -0.917023, -0.978309, -0.397223, -0.917023, -0.978309, 0.397223, -0.917023, 0.978309, -0.397223, -0.853813, -0.975892, -0.518323, -0.853813, -0.975892, 0.518323, -0.853813, 0.975892, -0.518323, -0.853813, 0.975892, 0.518323, -0.79176, -0.974761, -0.60913, -0.79176, -0.974761, 0.60913, -0.707103, -0.983887, -0.707097, -0.707103, -0.983887, 0.707097, -0.707103, 0.983887, -0.707097, -0.707103, 0.983887, 0.707097, -0.609138, 0.97476, -0.791754, -0.609138, 0.97476, 0.791754, -0.518332, -0.975889, -0.853807, -0.518332, -0.975889, 0.853807, -0.518332, 0.975889, -0.853807, -0.397393, 0.978225, -0.916943, -0.397393, 0.978225, 0.916943, -0.306598, -0.981834, -0.951079, -0.306598, -0.981834, 0.951079, -0.18408, -0.982434, -0.982434, -0.18408, -0.982434, 0.982434, -0.18408, 0.982434, -0.982434, -0.18408, 0.982434, 0.982434, 0.184038, -0.982441, -0.982441, 0.184038, -0.982441, 0.982441, 0.184038, 0.982441, -0.982441, 0.184038, 0.982441, 0.982441, 0.306731, -0.981785, 0.951032, 0.306731, 0.981785, -0.951032, 0.306731, 0.981785, 0.951032, 0.397198, -0.978324, -0.917035, 0.397198, 0.978324, 0.917035, 0.459081, -0.979594, 0.887733, 0.459081, 0.979594, -0.887733, 0.5183, -0.975911, -0.853827, 0.5183, 0.975911, -0.853827, 0.5183, 0.975911, 0.853827, 0.609111, -0.974785, 0.791775, 0.642894, -0.979738, -0.765301, 0.642894, 0.979738, -0.765301, 0.642894, 0.979738, 0.765301, 0.791813, -0.974646, -0.609058, 0.791813, -0.974646, 0.609058, 0.791813, 0.974646, -0.609058, 0.791813, 0.974646, 0.609058, 0.853885, -0.976024, -0.518202, 0.853885, -0.976024, 0.518202, 0.917016, 0.978348, -0.397238, 0.917016, 0.978348, 0.397238, 0.95108, -0.981878, -0.306596, 0.95108, -0.981878, 0.306596, 0.98243, -0.982666, -0.184106, 0.98243, -0.982666, 0.184106, 0.98243, 0.982666, -0.184106, 0.98243, 0.982666, 0.184106 )
[node name="Player" type="KinematicBody"]
script = ExtResource( 1 )
[node name="CamNode" type="Spatial" parent="."]
[node name="Camera" type="Camera" parent="CamNode"]
current = true
far = 8192.0
[node name="Body" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 )
mesh = SubResource( 1 )
material/0 = ExtResource( 3 )
[node name="Head" type="MeshInstance" parent="Body"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.25561, 0 )
mesh = SubResource( 3 )
material/0 = ExtResource( 3 )
[node name="Shoulder" type="Spatial" parent="Body"]
transform = Transform( 1, 0, 0, 0, 0.970296, 0.241922, 0, -0.241922, 0.970296, 0, 0.916597, 0 )
[node name="Gun" type="MeshInstance" parent="Body/Shoulder"]
transform = Transform( 0.1, 0, 0, 0, -3.27835e-08, -0.1, 0, 0.75, -4.37114e-09, 0.5, -0.017, -0.7 )
mesh = SubResource( 2 )
material/0 = ExtResource( 2 )
[node name="BodyCollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0 )
shape = SubResource( 8 )
[node name="CameraCollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.173484, -0.207686 )
shape = SubResource( 9 )
[node name="GunCollisionShape" type="CollisionShape" parent="."]
transform = Transform( 0.1, 0, 0, 0, 0.18507, -0.0970296, 0, 0.742276, 0.0241922, 0.5, -0.268852, -0.675192 )
shape = SubResource( 6 )
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 4 )

View File

@ -0,0 +1,32 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
sky_top_color = Color( 0.105882, 0.152941, 0.25098, 1 )
sky_horizon_color = Color( 0.309804, 0.352941, 0.45098, 1 )
sky_curve = 0.0931737
sky_energy = 10.0
ground_bottom_color = Color( 0.25, 0.25, 0.25, 1 )
ground_horizon_color = Color( 0.458, 0.458, 0.458, 1 )
sun_color = Color( 0.25, 0.25, 0.25, 1 )
sun_latitude = 36.3
sun_longitude = -138.0
sun_angle_min = 0.0
sun_angle_max = 27.19
sun_energy = 40.0
[resource]
background_mode = 2
background_sky = SubResource( 1 )
ambient_light_color = Color( 0.8, 0.8, 0.8, 1 )
ambient_light_sky_contribution = 0.0
fog_color = Color( 0.309804, 0.352941, 0.45098, 1 )
fog_sun_color = Color( 1, 1, 1, 1 )
fog_sun_amount = 0.17
fog_depth_end = 512.0
fog_depth_curve = 3.36358
tonemap_mode = 2
tonemap_white = 16.0
dof_blur_far_distance = 256.0
dof_blur_far_transition = 0.01
dof_blur_far_amount = 0.04
dof_blur_far_quality = 0

View File

@ -0,0 +1,32 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
sky_top_color = Color( 0.105882, 0.152941, 0.25098, 1 )
sky_horizon_color = Color( 0.309804, 0.352941, 0.45098, 1 )
sky_curve = 0.0931737
sky_energy = 10.0
ground_bottom_color = Color( 0.2415, 0.27405, 0.35, 1 )
ground_horizon_color = Color( 0.309804, 0.352941, 0.45098, 1 )
ground_energy = 10.0
sun_color = Color( 0.25, 0.25, 0.25, 1 )
sun_latitude = 36.3
sun_longitude = -138.0
sun_angle_min = 0.0
sun_angle_max = 27.19
sun_energy = 40.0
[resource]
background_mode = 2
background_sky = SubResource( 1 )
ambient_light_color = Color( 0.6, 0.6, 0.6, 1 )
ambient_light_sky_contribution = 0.0
fog_enabled = true
fog_color = Color( 0.309804, 0.352941, 0.45098, 1 )
fog_sun_color = Color( 1, 1, 1, 1 )
fog_depth_end = 1500.0
fog_depth_curve = 4.59479
tonemap_mode = 2
tonemap_white = 16.0
dof_blur_far_distance = 1024.0
dof_blur_far_amount = 0.04
dof_blur_far_quality = 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/Rock12_AO.jpg-a392a44c25220bb27985de02e413ad6a.s3tc.stex"
path.etc2="res://.import/Rock12_AO.jpg-a392a44c25220bb27985de02e413ad6a.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://fps_demo/textures/Rock12_AO.jpg"
dest_files=[ "res://.import/Rock12_AO.jpg-a392a44c25220bb27985de02e413ad6a.s3tc.stex", "res://.import/Rock12_AO.jpg-a392a44c25220bb27985de02e413ad6a.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/Rock12_col.jpg-a8b87ac27b3c31eda7c09299ddeedd9a.s3tc.stex"
path.etc2="res://.import/Rock12_col.jpg-a8b87ac27b3c31eda7c09299ddeedd9a.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://fps_demo/textures/Rock12_col.jpg"
dest_files=[ "res://.import/Rock12_col.jpg-a8b87ac27b3c31eda7c09299ddeedd9a.s3tc.stex", "res://.import/Rock12_col.jpg-a8b87ac27b3c31eda7c09299ddeedd9a.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 KiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/Rock12_disp.jpg-cecaaf697ec49e4c191fe55fcf553381.s3tc.stex"
path.etc2="res://.import/Rock12_disp.jpg-cecaaf697ec49e4c191fe55fcf553381.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://fps_demo/textures/Rock12_disp.jpg"
dest_files=[ "res://.import/Rock12_disp.jpg-cecaaf697ec49e4c191fe55fcf553381.s3tc.stex", "res://.import/Rock12_disp.jpg-cecaaf697ec49e4c191fe55fcf553381.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 MiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/Rock12_nrm.jpg-88926a3739726a6479054e2f16501f9c.s3tc.stex"
path.etc2="res://.import/Rock12_nrm.jpg-88926a3739726a6479054e2f16501f9c.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://fps_demo/textures/Rock12_nrm.jpg"
dest_files=[ "res://.import/Rock12_nrm.jpg-88926a3739726a6479054e2f16501f9c.s3tc.stex", "res://.import/Rock12_nrm.jpg-88926a3739726a6479054e2f16501f9c.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=1
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Rock12_rgh.jpg-ae49663595c6c4015390717f402e19dd.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://fps_demo/textures/Rock12_rgh.jpg"
dest_files=[ "res://.import/Rock12_rgh.jpg-ae49663595c6c4015390717f402e19dd.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 KiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/grass01_albedo.jpg-7f3e3f45d2894df0a2c0ee7e82bc6a1a.s3tc.stex"
path.etc2="res://.import/grass01_albedo.jpg-7f3e3f45d2894df0a2c0ee7e82bc6a1a.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://fps_demo/textures/grass01_albedo.jpg"
dest_files=[ "res://.import/grass01_albedo.jpg-7f3e3f45d2894df0a2c0ee7e82bc6a1a.s3tc.stex", "res://.import/grass01_albedo.jpg-7f3e3f45d2894df0a2c0ee7e82bc6a1a.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/grass01_ao.png-4ac82059c55d6528130d32f34bbebd2c.s3tc.stex"
path.etc2="res://.import/grass01_ao.png-4ac82059c55d6528130d32f34bbebd2c.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://fps_demo/textures/grass01_ao.png"
dest_files=[ "res://.import/grass01_ao.png-4ac82059c55d6528130d32f34bbebd2c.s3tc.stex", "res://.import/grass01_ao.png-4ac82059c55d6528130d32f34bbebd2c.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/grass01_height.png-b4e65e9c9253c246252b99ef0e1d6c94.s3tc.stex"
path.etc2="res://.import/grass01_height.png-b4e65e9c9253c246252b99ef0e1d6c94.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://fps_demo/textures/grass01_height.png"
dest_files=[ "res://.import/grass01_height.png-b4e65e9c9253c246252b99ef0e1d6c94.s3tc.stex", "res://.import/grass01_height.png-b4e65e9c9253c246252b99ef0e1d6c94.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/grass01_normal.png-9eb82ef454fc2b92cfe1151c3cc46541.s3tc.stex"
path.etc2="res://.import/grass01_normal.png-9eb82ef454fc2b92cfe1151c3cc46541.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://fps_demo/textures/grass01_normal.png"
dest_files=[ "res://.import/grass01_normal.png-9eb82ef454fc2b92cfe1151c3cc46541.s3tc.stex", "res://.import/grass01_normal.png-9eb82ef454fc2b92cfe1151c3cc46541.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=1
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/noise.jpg-5b2e0308cfda2bc3606cd052151f2230.s3tc.stex"
path.etc2="res://.import/noise.jpg-5b2e0308cfda2bc3606cd052151f2230.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://fps_demo/textures/noise.jpg"
dest_files=[ "res://.import/noise.jpg-5b2e0308cfda2bc3606cd052151f2230.s3tc.stex", "res://.import/noise.jpg-5b2e0308cfda2bc3606cd052151f2230.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/uv_checker_1k.png-bc83eed83c22878d7370085835c2fd90.s3tc.stex"
path.etc2="res://.import/uv_checker_1k.png-bc83eed83c22878d7370085835c2fd90.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://fps_demo/textures/uv_checker_1k.png"
dest_files=[ "res://.import/uv_checker_1k.png-bc83eed83c22878d7370085835c2fd90.s3tc.stex", "res://.import/uv_checker_1k.png-bc83eed83c22878d7370085835c2fd90.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -15,18 +15,67 @@ _global_script_class_icons={
[application]
config/name="New Game Project"
run/main_scene="res://dmc_terrain/main_lod.tscn"
config/name="Voxel Tools Demo"
run/main_scene="res://fps_demo/heightmap_smooth.tscn"
config/icon="res://icon.png"
[autoload]
DDD="*res://common/ddd.gd"
[physics]
[display]
3d/physics_engine="Bullet"
window/vsync/use_vsync=false
[input]
move_forward={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
]
}
move_backward={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
]
}
move_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
]
}
move_up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"unicode":0,"echo":false,"script":null)
]
}
move_down={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"unicode":0,"echo":false,"script":null)
]
}
jump={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
]
}
shoot_add={
"deadzone": 0.5,
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
]
}
shoot_del={
"deadzone": 0.5,
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null)
]
}
[rendering]
quality/shadows/filter_mode=2
environment/default_environment="res://default_env.tres"

BIN
screenshots/3d-noise.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB