Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial Sponza benchmark #47

Merged
merged 6 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions benchmarks/rendering/sponza.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
extends Benchmark

func _init():
test_render_cpu = true
test_render_gpu = true


class TestScene extends Node3D:

var sponza_scene = preload("res://benchmarks/rendering/sponza.tscn")
var sponza

var using_directional_light: bool
var using_omni_lights: bool

func _init():
sponza = sponza_scene.instantiate()
add_child(sponza)

func with_directional_light():
using_directional_light = true
return self

func with_omni_lights():
using_omni_lights = true
return self

func _ready():
$"Sponza/DirectionalLight3D".visible = using_directional_light
$"Sponza/OmniLights".visible = using_omni_lights

func _process(delta):
pass

func _exit_tree():
RenderingServer.free_rid(sponza)


func benchmark_sponza_ambient():
return TestScene.new()

func benchmark_sponza_directional():
return TestScene.new().with_directional_light()

func benchmark_sponza_omni():
return TestScene.new().with_omni_lights()

57 changes: 57 additions & 0 deletions benchmarks/rendering/sponza.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[gd_scene load_steps=2 format=3 uid="uid://lhj56divlnw3"]

[ext_resource type="PackedScene" uid="uid://b0c2qturgt8i6" path="res://thirdparty/sponza/sponza.glb" id="1_1w3b0"]

[node name="Sponza" type="Node3D"]

[node name="sponza" parent="." instance=ExtResource("1_1w3b0")]

[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(-4.37114e-08, 3.48787e-16, 1, 3.48787e-16, 1, -3.48787e-16, -1, 3.48787e-16, -4.37114e-08, 7.25, 0.9, -0.225)
current = true

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.5, -0.852869, 0.150384, 6.05662e-17, 0.173648, 0.984808, -0.866025, -0.492404, 0.0868241, 0, 0, 0)
shadow_enabled = true

[node name="OmniLights" type="Node3D" parent="."]

[node name="OmniLight3D" type="OmniLight3D" parent="OmniLights"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.05361, 0.966716, 0.907753)
light_energy = 0.5
shadow_enabled = true

[node name="OmniLight3D2" type="OmniLight3D" parent="OmniLights"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.05361, 0.966716, -1.35595)
light_energy = 0.5
shadow_enabled = true

[node name="OmniLight3D3" type="OmniLight3D" parent="OmniLights"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.85783, 0.966716, 0.907753)
light_energy = 0.5
shadow_enabled = true

[node name="OmniLight3D4" type="OmniLight3D" parent="OmniLights"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.85783, 0.966716, -1.35595)
light_energy = 0.5
shadow_enabled = true

[node name="OmniLight3D5" type="OmniLight3D" parent="OmniLights"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.99073, 1.39109, 2.534)
light_color = Color(1, 0.584314, 0, 1)
shadow_enabled = true

[node name="OmniLight3D6" type="OmniLight3D" parent="OmniLights"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.99073, 1.39109, -2.80553)
light_color = Color(0, 1, 0, 1)
shadow_enabled = true

[node name="OmniLight3D7" type="OmniLight3D" parent="OmniLights"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.5058, 1.39109, 2.534)
light_color = Color(0.701961, 0, 1, 1)
shadow_enabled = true

[node name="OmniLight3D8" type="OmniLight3D" parent="OmniLights"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.5058, 1.39109, -2.80553)
light_color = Color(0, 0, 1, 1)
shadow_enabled = true
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config_version=5

config/name="Godot Benchmarks"
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.2")
config/features=PackedStringArray("4.3")
config/icon="res://icon.png"

[autoload]
Expand Down
11 changes: 11 additions & 0 deletions thirdparty/sponza/Material__25.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://hs2ob5edfwom"]

[ext_resource type="Texture2D" uid="uid://dkub6fpbj3o0r" path="res://thirdparty/sponza/textures/lion.webp" id="1_tnn7u"]
[ext_resource type="Texture2D" uid="uid://cx87f7q45oulv" path="res://thirdparty/sponza/textures/lion_ddn.webp" id="2_prxi6"]

[resource]
resource_name = "Material__25"
albedo_texture = ExtResource("1_tnn7u")
normal_enabled = true
normal_texture = ExtResource("2_prxi6")
texture_filter = 5
11 changes: 11 additions & 0 deletions thirdparty/sponza/Material__298.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://cujxyiepujuat"]

[ext_resource type="Texture2D" uid="uid://clipou3fhmvxj" path="res://thirdparty/sponza/textures/background.webp" id="1_7atb2"]
[ext_resource type="Texture2D" uid="uid://lbhsqbq5crv6" path="res://thirdparty/sponza/textures/background_ddn.webp" id="2_ejjwe"]

[resource]
resource_name = "Material__298"
albedo_texture = ExtResource("1_7atb2")
normal_enabled = true
normal_texture = ExtResource("2_ejjwe")
texture_filter = 5
6 changes: 6 additions & 0 deletions thirdparty/sponza/Material__47.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://x6ogq1unkdsl"]

[resource]
resource_name = "Material__47"
albedo_color = Color(0.588, 0.588, 0.588, 1)
texture_filter = 5
9 changes: 9 additions & 0 deletions thirdparty/sponza/Material__57.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://cj1vtf8mboe12"]

[ext_resource type="Texture2D" uid="uid://drdycbp6gcpjn" path="res://thirdparty/sponza/textures/vase_plant.webp" id="1_bpr0x"]

[resource]
resource_name = "Material__57"
transparency = 4
albedo_texture = ExtResource("1_bpr0x")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/arch.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bxra8tljpa4eg"]

[ext_resource type="Texture2D" uid="uid://bgvqoi1hqfkk" path="res://thirdparty/sponza/textures/sponza_arch_diff.webp" id="1_1ftcv"]

[resource]
resource_name = "arch"
albedo_texture = ExtResource("1_1ftcv")
texture_filter = 5
10 changes: 10 additions & 0 deletions thirdparty/sponza/bricks.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://cvym4sc3s4aet"]

[ext_resource type="Texture2D" uid="uid://62k2ptb2o6mb" path="res://thirdparty/sponza/textures/spnza_bricks_a_diff.webp" id="1_3516i"]

[resource]
resource_name = "bricks"
albedo_texture = ExtResource("1_3516i")
normal_enabled = true
normal_texture = ExtResource("1_3516i")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/ceiling.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://cq7to4no56eux"]

[ext_resource type="Texture2D" uid="uid://bp6u702m0hn1g" path="res://thirdparty/sponza/textures/sponza_ceiling_a_diff.webp" id="1_qqtfa"]

[resource]
resource_name = "ceiling"
albedo_texture = ExtResource("1_qqtfa")
texture_filter = 5
12 changes: 12 additions & 0 deletions thirdparty/sponza/chain.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://cfx2ekbwhhggp"]

[ext_resource type="Texture2D" uid="uid://dcxb6tmdvaoeh" path="res://thirdparty/sponza/textures/chain_texture.webp" id="1_eqp7h"]
[ext_resource type="Texture2D" uid="uid://cdy41v8ops2yo" path="res://thirdparty/sponza/textures/chain_texture_ddn.webp" id="2_2kx3d"]

[resource]
resource_name = "chain"
transparency = 4
albedo_texture = ExtResource("1_eqp7h")
normal_enabled = true
normal_texture = ExtResource("2_2kx3d")
texture_filter = 5
11 changes: 11 additions & 0 deletions thirdparty/sponza/column_a.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://ucu8bs3r1jif"]

[ext_resource type="Texture2D" uid="uid://brbt3nvc6l8m2" path="res://thirdparty/sponza/textures/sponza_column_a_diff.webp" id="1_p6qpp"]
[ext_resource type="Texture2D" uid="uid://df5jk5wj07bh3" path="res://thirdparty/sponza/textures/sponza_column_a_ddn.webp" id="2_myx5k"]

[resource]
resource_name = "column_a"
albedo_texture = ExtResource("1_p6qpp")
normal_enabled = true
normal_texture = ExtResource("2_myx5k")
texture_filter = 5
11 changes: 11 additions & 0 deletions thirdparty/sponza/column_b.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://dfacanouflrfy"]

[ext_resource type="Texture2D" uid="uid://cmytc08hduswr" path="res://thirdparty/sponza/textures/sponza_column_b_diff.webp" id="1_p23kf"]
[ext_resource type="Texture2D" uid="uid://ebr4li6258pp" path="res://thirdparty/sponza/textures/sponza_column_b_ddn.webp" id="2_fuuma"]

[resource]
resource_name = "column_b"
albedo_texture = ExtResource("1_p23kf")
normal_enabled = true
normal_texture = ExtResource("2_fuuma")
texture_filter = 5
11 changes: 11 additions & 0 deletions thirdparty/sponza/column_c.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://bc543ekonhvyf"]

[ext_resource type="Texture2D" uid="uid://ch2qtl5gaiaf1" path="res://thirdparty/sponza/textures/sponza_column_c_diff.webp" id="1_n7bhk"]
[ext_resource type="Texture2D" uid="uid://bdrybxhvb125c" path="res://thirdparty/sponza/textures/sponza_column_c_ddn.webp" id="2_jx7v4"]

[resource]
resource_name = "column_c"
albedo_texture = ExtResource("1_n7bhk")
normal_enabled = true
normal_texture = ExtResource("2_jx7v4")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/details.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bxledl2mfrmyo"]

[ext_resource type="Texture2D" uid="uid://ekrij1dc03uk" path="res://thirdparty/sponza/textures/sponza_details_diff.webp" id="1_xyq0w"]

[resource]
resource_name = "details"
albedo_texture = ExtResource("1_xyq0w")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/fabric_a.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://b2k5wm0umiyg"]

[ext_resource type="Texture2D" uid="uid://d0cd8gxluuab7" path="res://thirdparty/sponza/textures/sponza_fabric_diff.webp" id="1_roq6h"]

[resource]
resource_name = "fabric_a"
albedo_texture = ExtResource("1_roq6h")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/fabric_c.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bgrv88wce7ond"]

[ext_resource type="Texture2D" uid="uid://o4gr4nm52rlo" path="res://thirdparty/sponza/textures/sponza_curtain_diff.webp" id="1_pw5sx"]

[resource]
resource_name = "fabric_c"
albedo_texture = ExtResource("1_pw5sx")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/fabric_d.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://1b35kbua7c1l"]

[ext_resource type="Texture2D" uid="uid://qcdx5nms8qye" path="res://thirdparty/sponza/textures/sponza_fabric_blue_diff.webp" id="1_weenx"]

[resource]
resource_name = "fabric_d"
albedo_texture = ExtResource("1_weenx")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/fabric_e.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://dxghi28dk231n"]

[ext_resource type="Texture2D" uid="uid://eke5bnjw2wmu" path="res://thirdparty/sponza/textures/sponza_fabric_green_diff.webp" id="1_vx7aa"]

[resource]
resource_name = "fabric_e"
albedo_texture = ExtResource("1_vx7aa")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/fabric_f.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://wob3ru8lvm6t"]

[ext_resource type="Texture2D" uid="uid://tc1y3mhctyw1" path="res://thirdparty/sponza/textures/sponza_curtain_green_diff.webp" id="1_wibte"]

[resource]
resource_name = "fabric_f"
albedo_texture = ExtResource("1_wibte")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/fabric_g.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://yyr032hvmw4v"]

[ext_resource type="Texture2D" uid="uid://km0r414keg4m" path="res://thirdparty/sponza/textures/sponza_curtain_blue_diff.webp" id="1_mmtlw"]

[resource]
resource_name = "fabric_g"
albedo_texture = ExtResource("1_mmtlw")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/flagpole.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://cwatjyk4hqkhn"]

[ext_resource type="Texture2D" uid="uid://pvlycu0rk1d4" path="res://thirdparty/sponza/textures/sponza_flagpole_diff.webp" id="1_tvdlb"]

[resource]
resource_name = "flagpole"
albedo_texture = ExtResource("1_tvdlb")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/floor.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://lgwhv3agifiw"]

[ext_resource type="Texture2D" uid="uid://dqbqbh0ej28" path="res://thirdparty/sponza/textures/sponza_floor_a_diff.webp" id="1_ufulj"]

[resource]
resource_name = "floor"
albedo_texture = ExtResource("1_ufulj")
texture_filter = 5
12 changes: 12 additions & 0 deletions thirdparty/sponza/leaf.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://bfeekuxw8xn3c"]

[ext_resource type="Texture2D" uid="uid://4ddsefheyfvd" path="res://thirdparty/sponza/textures/sponza_thorn_diff.webp" id="1_1xbna"]
[ext_resource type="Texture2D" uid="uid://bjksnrd26o88d" path="res://thirdparty/sponza/textures/sponza_thorn_ddn.webp" id="2_wijuo"]

[resource]
resource_name = "leaf"
transparency = 4
albedo_texture = ExtResource("1_1xbna")
normal_enabled = true
normal_texture = ExtResource("2_wijuo")
texture_filter = 5
8 changes: 8 additions & 0 deletions thirdparty/sponza/roof.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://c4tpifbg7wrtp"]

[ext_resource type="Texture2D" uid="uid://chjkjxwkaiah4" path="res://thirdparty/sponza/textures/sponza_roof_diff.webp" id="1_kngsu"]

[resource]
resource_name = "roof"
albedo_texture = ExtResource("1_kngsu")
texture_filter = 5
Binary file added thirdparty/sponza/sponza.glb
Binary file not shown.
Loading