Skip to content

Commit

Permalink
Merge branch 'particles_instanced' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
hsm4 committed Nov 27, 2023
2 parents 04e8e23 + 7122373 commit 006b46e
Show file tree
Hide file tree
Showing 36 changed files with 1,551 additions and 688 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
[![Build Windows](https://github.com/cpvrlab/SLProject4/actions/workflows/build-x86_64-windows.yml/badge.svg)](https://github.com/cpvrlab/SLProject4/actions/workflows/build-x86_64-windows.yml)
[![Build macOS](https://github.com/cpvrlab/SLProject4/actions/workflows/build-x86_64-macos.yml/badge.svg)](https://github.com/cpvrlab/SLProject4/actions/workflows/build-x86_64-macos.yml)
[![Build Emscripten](https://github.com/cpvrlab/SLProject4/actions/workflows/build-wasm-emscripten.yml/badge.svg)](https://github.com/cpvrlab/SLProject4/actions/workflows/build-wasm-emscripten.yml)
[![Build Online Docs](https://github.com/cpvrlab/SLProject4/actions/workflows/build-docs.yml/badge.svg)](https://github.com/cpvrlab/SLProject4/actions/workflows/build-docs.yml)

SL stands for Scene Library. It is developed at the Berne University of Applied Sciences (BFH) in Switzerland and is used for student projects in the cpvrLab. The various applications show what you can learn in three semesters about 3D computer graphics in real time rendering and ray tracing. The framework is built in C++ and OpenGL ES and can be built for Windows, Linux, macOS (Intel & arm64), Android, Apple iOS and for WebAssembly enabled browsers. The framework can render alternatively with Ray Tracing and Path Tracing which provides in addition high quality transparencies, reflections and soft shadows. For a complete feature list see the [SLProject4 wiki](https://github.com/cpvrlab/SLProject4/wiki).
SL stands for Scene Library. It is developed at the Berne University of Applied Sciences (BFH) in Switzerland and is used for student projects in the cpvrLab. The various applications show what you can learn in three semesters about 3D computer graphics in real-time rendering and ray tracing. The framework is built in C++ and OpenGL ES and can be built for Windows, Linux, macOS (Intel & arm64), Android, Apple iOS, and WebAssembly-enabled browsers. The framework can render alternatively with Ray Tracing and Path Tracing, which provides high-quality transparencies, reflections, and soft shadows. For a complete feature list see the [SLProject4 wiki](https://github.com/cpvrlab/SLProject4/wiki).

## How to get the SLProject4

The SLProject4 is hosted at GitHub as a GIT repository.
The SLProject4 is hosted on GitHub as a GIT repository.
[GIT](http://git-scm.com/) is a distributed versioning control system.

To clone SLProject4, use the following command:
Expand All @@ -18,7 +19,7 @@ cd <Path to where you want the SLProject4 folder>
git clone https://github.com/cpvrlab/SLProject4.git
```

For people with an aversion to the command line, a GIT GUI tool, such as the [GitHub Desktop Client](https://desktop.github.com), can be used. To get the latest additions to SLProject4, please checkout the develop branch:
For people with an aversion to the command line, a GIT GUI tool, such as the [GitHub Desktop Client](https://desktop.github.com), can be used. To get the latest additions to SLProject4, please check the develop branch:

```
git checkout develop
Expand Down
59 changes: 31 additions & 28 deletions apps/app_demo_slproject/source/AppDemoGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1775,27 +1775,20 @@ void AppDemoGui::buildMenuBar(SLScene* s, SLSceneView* sv)

if (ImGui::BeginMenu("Particle Systems"))
{
if (stateGL->glHasGeometryShaders())
{
if (ImGui::MenuItem("First Particle System", nullptr, sid == SID_ParticleSystem_First))
s->onLoad(am, s, sv, SID_ParticleSystem_First);
if (ImGui::MenuItem("Demo Particle System", nullptr, sid == SID_ParticleSystem_Demo))
s->onLoad(am, s, sv, SID_ParticleSystem_Demo);
if (ImGui::MenuItem("Dust Storm Particle System", nullptr, sid == SID_ParticleSystem_DustStorm))
s->onLoad(am, s, sv, SID_ParticleSystem_DustStorm);
if (ImGui::MenuItem("Fountain Particle System", nullptr, sid == SID_ParticleSystem_Fountain))
s->onLoad(am, s, sv, SID_ParticleSystem_Fountain);
if (ImGui::MenuItem("Sun Particle System", nullptr, sid == SID_ParticleSystem_Sun))
s->onLoad(am, s, sv, SID_ParticleSystem_Sun);
if (ImGui::MenuItem("Ring of Fire Particle System", nullptr, sid == SID_ParticleSystem_RingOfFire))
s->onLoad(am, s, sv, SID_ParticleSystem_RingOfFire);
if (ImGui::MenuItem("Complex Fire Particle System", nullptr, sid == SID_ParticleSystem_FireComplex))
s->onLoad(am, s, sv, SID_ParticleSystem_FireComplex);
}
else
{
ImGui::MenuItem("Particles need OpenGL >= 4.0 or OpenGLES >= 3.1", nullptr, false, false);
}
if (ImGui::MenuItem("First Particle System", nullptr, sid == SID_ParticleSystem_First))
s->onLoad(am, s, sv, SID_ParticleSystem_First);
if (ImGui::MenuItem("Demo Particle System", nullptr, sid == SID_ParticleSystem_Demo))
s->onLoad(am, s, sv, SID_ParticleSystem_Demo);
if (ImGui::MenuItem("Dust Storm Particle System", nullptr, sid == SID_ParticleSystem_DustStorm))
s->onLoad(am, s, sv, SID_ParticleSystem_DustStorm);
if (ImGui::MenuItem("Fountain Particle System", nullptr, sid == SID_ParticleSystem_Fountain))
s->onLoad(am, s, sv, SID_ParticleSystem_Fountain);
if (ImGui::MenuItem("Sun Particle System", nullptr, sid == SID_ParticleSystem_Sun))
s->onLoad(am, s, sv, SID_ParticleSystem_Sun);
if (ImGui::MenuItem("Ring of Fire Particle System", nullptr, sid == SID_ParticleSystem_RingOfFire))
s->onLoad(am, s, sv, SID_ParticleSystem_RingOfFire);
if (ImGui::MenuItem("Complex Fire Particle System", nullptr, sid == SID_ParticleSystem_FireComplex))
s->onLoad(am, s, sv, SID_ParticleSystem_FireComplex);

ImGui::EndMenu();
}
Expand Down Expand Up @@ -1964,13 +1957,10 @@ void AppDemoGui::buildMenuBar(SLScene* s, SLSceneView* sv)
s->onLoad(am, s, sv, SID_Benchmark6_ColumnsLOD);
if (ImGui::MenuItem("Jan's Universe", nullptr, sid == SID_Benchmark7_JansUniverse))
s->onLoad(am, s, sv, SID_Benchmark7_JansUniverse);
if (stateGL->glHasGeometryShaders())
{
if (ImGui::MenuItem("Particle System lot of fire complex", nullptr, sid == SID_Benchmark8_ParticleSystemFireComplex))
s->onLoad(am, s, sv, SID_Benchmark8_ParticleSystemFireComplex);
if (ImGui::MenuItem("Particle System lot of particle", nullptr, sid == SID_Benchmark9_ParticleSystemManyParticles))
s->onLoad(am, s, sv, SID_Benchmark9_ParticleSystemManyParticles);
}
if (ImGui::MenuItem("Particle System lot of fire complex", nullptr, sid == SID_Benchmark8_ParticleSystemFireComplex))
s->onLoad(am, s, sv, SID_Benchmark8_ParticleSystemFireComplex);
if (ImGui::MenuItem("Particle System lot of particle", nullptr, sid == SID_Benchmark9_ParticleSystemManyParticles))
s->onLoad(am, s, sv, SID_Benchmark9_ParticleSystemManyParticles);
ImGui::EndMenu();
}

Expand Down Expand Up @@ -2393,6 +2383,9 @@ void AppDemoGui::buildMenuBar(SLScene* s, SLSceneView* sv)
if (ImGui::MenuItem("Skeleton", "K", sv->drawBits()->get(SL_DB_SKELETON)))
sv->drawBits()->toggle(SL_DB_SKELETON);

if (ImGui::MenuItem("GPU Skinning", nullptr, sv->drawBits()->get(SL_DB_GPU_SKINNING)))
sv->drawBits()->toggle(SL_DB_GPU_SKINNING);

if (ImGui::MenuItem("All off"))
sv->drawBits()->allOff();

Expand All @@ -2407,6 +2400,7 @@ void AppDemoGui::buildMenuBar(SLScene* s, SLSceneView* sv)
sv->drawBits()->on(SL_DB_BBOX);
sv->drawBits()->on(SL_DB_SKELETON);
sv->drawBits()->on(SL_DB_CULLOFF);
sv->drawBits()->on(SL_DB_GPU_SKINNING);
}

ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.65f);
Expand Down Expand Up @@ -3770,6 +3764,13 @@ void AppDemoGui::buildProperties(SLScene* s, SLSceneView* sv)
ps->isGenerated(false);
}

bool renderInstanced = ps->renderInstanced();
if (ImGui::Checkbox("Instanced draw", &renderInstanced))
{
ps->drawInstanced(renderInstanced);
ps->isGenerated(false);
}

// TTL (Time to live)
if (ImGui::CollapsingHeader("Time to live"))
{
Expand Down Expand Up @@ -4333,6 +4334,7 @@ void AppDemoGui::buildProperties(SLScene* s, SLSceneView* sv)

ImGui::TreePop();
}

if (m->program() != nullptr)
{
for (auto* shd : m->program()->shaders())
Expand Down Expand Up @@ -4367,6 +4369,7 @@ void AppDemoGui::buildProperties(SLScene* s, SLSceneView* sv)
}
}
}

ImGui::TreePop();
}
}
Expand Down
Loading

0 comments on commit 006b46e

Please sign in to comment.