mirror of
https://github.com/godotengine/godot-benchmarks.git
synced 2026-01-05 10:10:08 +03:00
Add initial Sponza benchmark (#47)
* add Sponza.dae and related assets files copied from: https://github.com/Calinou/godot-sponza/tree/4.0-dev * [wip] add sponza benchmark * add script to tweak sponza materials * add omni lights + enable shadows * Remove unused resources from Sponza * Convert Sponza to glTF + lossless WebP This greatly decreases file size and speeds up loading. --------- Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
This commit is contained in:
committed by
GitHub
parent
9b9a195924
commit
ff141decc4
47
benchmarks/rendering/sponza.gd
Normal file
47
benchmarks/rendering/sponza.gd
Normal file
@@ -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
benchmarks/rendering/sponza.tscn
Normal file
57
benchmarks/rendering/sponza.tscn
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user