• Stars
    star
    231
  • Rank 173,434 (Top 4 %)
  • Language
    C++
  • Created about 10 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of experiments, samples and other bits of code.

Cinder Experiments

A collection of experiments, samples and other bits of code. (Samples have been tested with Cinder 0.9 on MacOSX and Windows with a ATI Gpu).

Cascaded Shadow Mapping

Cascaded Shadow Mapping is a common method to get high resolution shadows near the viewer. This sample shows the very basic way of using this technique by splitting the frustum into different shadow maps. CSM has its own issues but usually provides better shadow resolution near the viewer and lower resolutions far away. The sample uses ESM for the shadowing algorithm (see the ESM sample for more infos about ESM).

One easy improvement to this sample is to use the approach shown in the GpuParrallelReduction sample to find the minimum and maximum depth of the scene and use those values to better fit what the viewer see from the scene. Other approaches involve, better frustum culling, better splitting scheme or more stable samples distributions.

Some references :
https://mynameismjp.wordpress.com/2013/09/10/shadow-maps/ http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html https://software.intel.com/en-us/articles/sample-distribution-shadow-maps http://blogs.aerys.in/jeanmarc-leroux/2015/01/21/exponential-cascaded-shadow-mapping-with-webgl/ https://github.com/NVIDIAGameWorks/OpenGLSamples/blob/master/samples/gl4-maxwell/CascadedShadowMapping/CascadedShadowMappingRenderer.cpp

Image Image

Color Grading

This sample shows a really easy way to add proper color grading to your apps. The trick is to store a 3d color lookup table and to use it to filter the output of a fragment shader. The nice thing about it is that you can use Photoshop or any other editing tool to create the right look and then replicate the exact same grading at a really low cost (the cost of one extra texture sample per fragment).

Press 'e' top open photoshop and live edit the color grading. When the file is saved in photoshop, the app automatically reloads the color grading.

Image

Exponential Shadow Mapping

Shadow Mapping is a vast subject and every approach comes with their own downsides. Basic shadow mapping have precision, aliasing,shadow acne and peter-panning issues, variance shadow mapping improves this but introduces light bleeding, etc... Exponential shadow mapping is an easy and inexpensive way to get rid of most of the above, but it (of course) comes with its own issues as well. The nice thing is that the shadow map can be inexpensively filtered in screenspace to produce softer shadows. On the other hand the main issue with ESM is that the closer a shadow is to the caster the brighter the shadow will be. Which may look weird in some cases. This is more or less fixed by using an "over-darkening" value but it doesn't work all the time.

A few interesting links :
http://advancedgraphics.marries.nl/presentationslides/13_exponential_shadow_maps.pdf http://www.sunandblackcat.com/tipFullView.php?l=eng&topicid=35 http://nolimitsdesigns.com/tag/exponential-shadow-map/ http://web4.cs.ucl.ac.uk/staff/j.kautz/publications/esm_gi08.pdf https://pixelstoomany.wordpress.com/2008/06/12/a-conceptually-simpler-way-to-derive-exponential-shadow-maps-sample-code/ http://www.olhovsky.com/2011/07/exponential-shadow-map-mFiltering-in-hlsl/

Image

Gpu Parrallel Reduction

Not a particularly exciting sample but a usefull technique. It can be use to gatter the average brightness of a scene and improve tonemapping, or to get the minimum and maximal depth and improve shadow mapping algorithm, etc...

The sample simply show how to use the different mipmap level of a texture to progressively reduce its size until its reasonable to copy it back to the cpu and read the results.

Parallax Corrected Cubemap

Cubemap environment mapping is the most straightforward way to add reflection to a scene. Usually cubemaps reflections represent infinitely far away reflections. This sample shows how to correct the texture lookup to have proper local reflections. This is not shown in this sample but this can also be used to fake small local light sources as well. The sample uses lightmapping to keep the code simple.

Here's some interesting links on the subject :
https://seblagarde.wordpress.com/2012/11/28/siggraph-2012-talk/ https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/ http://c0de517e.blogspot.be/2015/03/being-more-wrong-parallax-corrected.html http://www.clicktorelease.com/blog/making-of-cruciform http://gpupro.blogspot.be/2013/02/gpu-pro-4-practical-planar-reflections.html http://learnopengl.com/#!Advanced-OpenGL/Cubemaps http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf

Image

PBR Basics

This sample show the basics of a physically based shading workflow. Mainly adapted from disney and epic papers on the subject. PBR without textures is not particularly interesting, but it's a good introduction.

Image

PBR Image Based Lighting

Image Based Lighting Diffuse and Specular reflections. Uses Cubemaps created in CmftStudio. This sample uses a full approximation as described on this Unreal Engine blog post.

Image Image

PBR Texturing Basics

Basic use of textures in a physically based shading workflow.

Image Image

Tessellated Noise

Useless update to the Tessellation Shader sample. Just playing around with noise sums in the vertex shader. Shading is absolutely wrong.

Image

Tessellation Shader

Small sample implementing Philip Rideout article on "Triangle Tessellation with OpenGL 4.0".

Image

Viewport Array

Small sample showing the use of glViewportArrayv and gl_ViewportIndex to render to multiple viewports. glViewportArrayv is a nice way to specifies a list of viewports that can be later used in the geometry shader. By setting gl_ViewportIndex in the geometry shader you can re-direct your drawing calls to a specific viewport. Used along arrays of projections and view matrices it really ease the setup of a multiple viewport / 3d editor like view.

Image

Wireframe Geometry Shader

Geometry and fragment shader for solid wireframe rendering. Mostly adapted from Florian Boesch great post on barycentric coordinates.

Image

License

Copyright (c) 2015, Simon Geilfus - All rights reserved. This code is intended for use with the Cinder C++ library: http://libcinder.org

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

More Repositories

1

Cinder-ImGui

Dear ImGui Renderer/Wrapper for Cinder
C++
156
star
2

SimplexNoise

Collection of Simplex Noise functions
C++
127
star
3

Watchdog

File / directory watcher for c++11 and boost
C++
123
star
4

GroveApp

C++
101
star
5

Cinder-Runtime

Runtime-Compiled C++ for Cinder
C++
57
star
6

FlyingTokyo19

Cinder C++ Workshop at Rhizomatiks - FlyingTokyo19 - May 2016
C++
57
star
7

SpacePartitioning

A collection of Space Partitioning Algorithms for Cinder
C++
45
star
8

Cinder-CodeEditor

In-App full-featured Code Editor
JavaScript
25
star
9

Cinder-OculusRift

HMD Camera setup and lense distortion for the Oculus Rift.
C++
24
star
10

Cinder-AssetManager

Supports hot reloading and asynchronous loading of assets (Replaced by https://github.com/simongeilfus/Watchdog)
C++
19
star
11

Cinder-Cereal

Add serialization support for Cinder's classes.
C++
17
star
12

HalfEdge

Work in progress Half-Edge mesh library
C++
16
star
13

Cinder-Cmft

Thin wrapper around Cmft for use with Cinder
C++
12
star
14

SharedMemoryUtils

C++
11
star
15

Cinder-Angelscript

Thin cinder wrapper around Angelscript
C++
10
star
16

PoissonDiskDistribution

C++
9
star
17

Cinder-SLB

Lua Scripting for Cinder ( Wrap SLB and luaGL )
C
8
star
18

CinderAndScriptsClass

C++
8
star
19

Triangulation

C++
7
star
20

Cinder-LiveAssetManager

New block here : https://github.com/simongeilfus/Cinder-AssetManager
C++
7
star
21

FontAwesomeCpp

Helper and generator classes to ease the use of FontAwesome in c++.
C++
7
star
22

Paleodictyon-Gwen-Wrapper

C++
6
star
23

Cinder-Chipmunk

Basic OO Chipmunk wrapper for Cinder.
Objective-C
5
star
24

Cinder-Gx

C++
5
star
25

Cinder-Qhull

Qhull block for Cinder
C
4
star
26

Cinder-GlslProgHelper

Adds preprocessor features to Cinder::GlslProg ( #include, #define, etc... )
C++
3
star
27

Cinder-Gizmo

Basic 3D manipulation library for Cinder.
C++
2
star
28

Cinder-OpenMesh

OpenMesh library
C++
2
star
29

Cinder-Shader

Small addition to Cinder's Glsl Shaders. Allow attrib location binding, transform feedback and auto reloading while you edit the code.
C++
2
star
30

project_starter_kit

c++ project starter kit
C++
1
star
31

Cinder-Gwen-1

Gwen (GUI Without Extravagant Nonsense) for Cinder
C++
1
star
32

Clang-Parser

C++
1
star
33

CinderCMakeBoilerplate

Basic project structure and tools for working with Cinder and CMake
CMake
1
star
34

LuaBindings

Sources for Cinder-LuaBind / libLuaBindings.a
C++
1
star
35

NvidiaEnablement

One-liner block for Cinder to force enable Nvidia Optimus on windows laptops
C
1
star