diff --git a/RavEngine b/RavEngine index 306d29a..bf06bf8 160000 --- a/RavEngine +++ b/RavEngine @@ -1 +1 @@ -Subproject commit 306d29a1483294ceab3429703c098b489227505d +Subproject commit bf06bf8147e94ec951e066738fb7d3c79397e400 diff --git a/Samples/Rendering/main.cpp b/Samples/Rendering/main.cpp index 6cad8d0..90f8213 100644 --- a/Samples/Rendering/main.cpp +++ b/Samples/Rendering/main.cpp @@ -33,25 +33,11 @@ struct SmokeParticleUpdateMaterial : public ParticleUpdateMaterial { SmokeParticleUpdateMaterial() : ParticleUpdateMaterial("SmokeParticleInit", "SmokeParticleUpdate") {}; }; -struct SmokeParticleRenderMaterial : public RavEngine::BillboardRenderParticleMaterial { - SmokeParticleRenderMaterial() : BillboardRenderParticleMaterial("default_billboard_particle","default_billboard_particle") {} - - uint16_t ParticleUserDataSize() const final { - return 0; // needs no extra data - } -}; struct FireParticleUpdateMaterial : public ParticleUpdateMaterial { FireParticleUpdateMaterial() : ParticleUpdateMaterial("FireParticleInit", "FireParticleUpdate") {} }; -struct FireParticleRenderMaterial : public RavEngine::BillboardRenderParticleMaterial { - FireParticleRenderMaterial() : BillboardRenderParticleMaterial("default_billboard_particle", "default_billboard_particle") {}; - - uint16_t ParticleUserDataSize() const final { - return 0; - } -}; struct Level : public RavEngine::World { @@ -120,14 +106,16 @@ struct Level : public RavEngine::World { lightsEntity.GetTransform().LocalRotateDelta(vector3{ deg_to_rad(45), deg_to_rad(45),0 }); auto smokeParticleEntity = Instantiate(); - auto smokeRenderMat = RavEngine::New(); + auto particleRenderMat = New(); + + auto smokeRenderMat = RavEngine::New(particleRenderMat); smokeRenderMat->spriteTex = Texture::Manager::Get("smoke.png"); smokeRenderMat->spriteDim = { .numSpritesWidth = 3, .numSpritesHeight = 3 }; - auto smokeUpdateMat = New(); + auto smokeUpdateMat = New(New()); auto& smokeEmitter = smokeParticleEntity.EmplaceComponent(8192, smokeUpdateMat, smokeRenderMat); // number of particles we want //smokeEmitter.mode = ParticleEmitter::Mode::Burst; @@ -136,13 +124,13 @@ struct Level : public RavEngine::World { smokeEmitter.SetEmissionRate(1000); auto fireParticleEntity = Instantiate(); - auto fireRenderMat = New(); + auto fireRenderMat = RavEngine::New(particleRenderMat); fireRenderMat->spriteTex = Texture::Manager::Get("fire.png"); fireRenderMat->spriteDim = { .numSpritesWidth = 11, .numSpritesHeight = 1 }; - auto fireUpdateMat = New(); + auto fireUpdateMat = New(New()); auto& fireEmitter = fireParticleEntity.EmplaceComponent(8192, fireUpdateMat, fireRenderMat); fireEmitter.Play(); fireEmitter.SetEmissionRate(1000);