From 2f3393e101b80b7faaf99a30641ca354813ca86d Mon Sep 17 00:00:00 2001 From: Panos Karabelas Date: Tue, 31 Dec 2024 23:17:40 +0000 Subject: [PATCH] [game] fixed missing plants texture --- readme.md | 2 +- .../geometrygenerator.h => Core/geometry_generator.h} | 0 runtime/Game/Game.cpp | 8 +++++--- runtime/Rendering/Renderer.cpp | 2 +- runtime/Rendering/Renderer_Resources.cpp | 5 ++--- 5 files changed, 9 insertions(+), 8 deletions(-) rename runtime/{Geometry/geometrygenerator.h => Core/geometry_generator.h} (100%) diff --git a/readme.md b/readme.md index cb0a5a5eb..c15f02d1f 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ -

Spartan Engine is one of the most advanced one-man game engines out there, pushing the limits of real-time solutions. What started as a portfolio project has evolved into a cutting-edge platform for developers to explore, learn, and contribute. This isn't an engine for the average user, it's designed for advanced research and experimentation, ideal for industry veterans looking to experiment, not to build a game (yet). With a thriving Discord community of over 440 members, including industry veterans, and contribution perks that you won't believe when you see, it's one of the most unique projects you'll ever come across.

+

Spartan Engine is one of the most advanced one-man game engines out there, pushing the limits of real-time approaches. What started as a portfolio project has evolved into a cutting-edge project for developers to explore, learn, and contribute. This isn't an engine for the average user, it's designed for advanced research and experimentation, ideal for industry veterans looking to experiment, not to build a game (yet). With a thriving Discord community of over 440 members, including industry veterans, and contribution perks that you won't believe when you see, it's one of the most unique projects you'll ever come across.

- For occasional updates regarding the project's development, you can follow me on X. diff --git a/runtime/Geometry/geometrygenerator.h b/runtime/Core/geometry_generator.h similarity index 100% rename from runtime/Geometry/geometrygenerator.h rename to runtime/Core/geometry_generator.h diff --git a/runtime/Game/Game.cpp b/runtime/Game/Game.cpp index 89c877c0e..3e7cf4e35 100644 --- a/runtime/Game/Game.cpp +++ b/runtime/Game/Game.cpp @@ -657,14 +657,16 @@ namespace Spartan Renderable* renderable = child->GetComponent().get(); renderable->SetFlag(RenderableFlags::CastsShadows, false); // cheaper and screen space shadows are enough - // tweak material - Material* material = renderable->GetMaterial(); + // create material as the model doesn't do it + shared_ptr material = make_shared(); + material->SetResourceFilePath("project\\terrain\\vegetation_plant_1\\ormbunke" + string(EXTENSION_MATERIAL)); material->SetColor(Color::standard_white); material->SetTexture(MaterialTextureType::Color, "project\\terrain\\vegetation_plant_1\\ormbunke.png"); material->SetProperty(MaterialProperty::SubsurfaceScattering, 0.0f); material->SetProperty(MaterialProperty::VertexAnimateWind, 1.0f); material->SetProperty(MaterialProperty::WorldSpaceHeight, renderable->GetBoundingBox(BoundingBoxType::Transformed).GetSize().y); material->SetProperty(MaterialProperty::CullMode, static_cast(RHI_CullMode::None)); + renderable->SetMaterial(material); // generate instances vector instances; @@ -678,7 +680,7 @@ namespace Spartan void create_sponza() { - create_camera(Vector3(19.2692f, 2.65f, 0.1677), Vector3(-18.0f, -90.0f, 0.0f)); + create_camera(Vector3(19.2692f, 2.65f, 0.1677f), Vector3(-18.0f, -90.0f, 0.0f)); create_sun(LightIntensity::black_hole, false); create_music("project\\music\\jake_chudnow_olive.mp3"); diff --git a/runtime/Rendering/Renderer.cpp b/runtime/Rendering/Renderer.cpp index 2a2675977..f1dcd0a04 100644 --- a/runtime/Rendering/Renderer.cpp +++ b/runtime/Rendering/Renderer.cpp @@ -158,7 +158,7 @@ namespace Spartan SetResolutionOutput(width, height, false); // set the render resolution to something smaller than the output resolution - // this is done because FSR 2 is not good at doing TAA if the render resolution is the same as the output resolution + // this is done because FSR is not good at doing TAA if the render resolution is the same as the output resolution SetResolutionRender(1920, 1080, false); // the resolution/size of the editor's viewport, this is overridden by the editor based on the actual viewport size diff --git a/runtime/Rendering/Renderer_Resources.cpp b/runtime/Rendering/Renderer_Resources.cpp index 0f9e5d386..762f638b7 100644 --- a/runtime/Rendering/Renderer_Resources.cpp +++ b/runtime/Rendering/Renderer_Resources.cpp @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "pch.h" #include "Window.h" #include "Renderer.h" -#include "../Geometry/geometrygenerator.h" +#include "../Core/geometry_generator.h" #include "../World/Components/Light.h" #include "../Resource/ResourceCache.h" #include "../RHI/RHI_Texture.h" @@ -37,7 +37,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifdef _MSC_VER #include "../RHI/RHI_FidelityFX.h" #endif - //======================================== //= NAMESPACES =============== @@ -150,7 +149,7 @@ namespace Spartan // anisotropic { // compute mip bias for enhanced texture detail in upsampling, applicable when output resolution is higher than render resolution - // this adjustment, beneficial even without FSR 2, ensures textures remain detailed at higher output resolutions by applying a negative bias + // this adjustment, beneficial even without FSR, ensures textures remain detailed at higher output resolutions by applying a negative bias float mip_bias_new = 0.0f; if (GetResolutionOutput().x > GetResolutionRender().x) {