All Projects → CJT-Jackton → Crystal-Caustics

CJT-Jackton / Crystal-Caustics

Licence: BSD-2-Clause license
💎 Approximated crystal caustics effect in Unity.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Crystal-Caustics

glDelegateBench
quick and dirty inference time benchmark for TFLite gles delegate
Stars: ✭ 17 (-71.67%)
Mutual labels:  compute-shader
sokol gp
Minimal modern efficient cross platform 2D graphics painter in C
Stars: ✭ 228 (+280%)
Mutual labels:  rendering
Fall2021
Base repository for Dartmouth's CS87/287 (Fall 2021).
Stars: ✭ 43 (-28.33%)
Mutual labels:  rendering
GLGrassRenderer
OpenGL Grass Renderer
Stars: ✭ 63 (+5%)
Mutual labels:  compute-shader
Nexus
🖼️ Actionscript 3, GPU accelerated 2D game engine using Stage3D
Stars: ✭ 12 (-80%)
Mutual labels:  rendering
swengine
StarWind Game Engine
Stars: ✭ 14 (-76.67%)
Mutual labels:  rendering
phantom
👻 A reactive DOM rendering engine for building UIs.
Stars: ✭ 16 (-73.33%)
Mutual labels:  rendering
Iyan3d
Iyan 3D Professional Edition - 3D animation app for iOS
Stars: ✭ 27 (-55%)
Mutual labels:  rendering
ph-pdf-layout
Java library for creating fluid page layouts with Apache PDFBox. Supporting multi-page tables, different page layouts etc.
Stars: ✭ 33 (-45%)
Mutual labels:  rendering
electron-shadermonki
a reserch desktop app based on electron
Stars: ✭ 31 (-48.33%)
Mutual labels:  rendering
Coherence
Blender viewport renderer using the Unity Engine
Stars: ✭ 28 (-53.33%)
Mutual labels:  rendering
Yune
GPU based framework for writing Raytracers/Pathtracers. (Pronounced as "Yu-nay")
Stars: ✭ 64 (+6.67%)
Mutual labels:  rendering
scenery
Flexible VR Visualisation for Volumetric and Geometric Data on the Java VM, powered by Kotlin and Vulkan
Stars: ✭ 107 (+78.33%)
Mutual labels:  rendering
Hydrogen
SUPER Lightweight Canvas Display List for drawing objects on 2D Canvas
Stars: ✭ 13 (-78.33%)
Mutual labels:  rendering
UnityGrassShader
Unity mesh generation + compute shader for grass simulation.
Stars: ✭ 18 (-70%)
Mutual labels:  compute-shader
RefRESH
Create RefRESH data: dataset tools for Learning Rigidity in Dynamic Scenes with a Moving Camera for 3D Motion Field Estimation (ECCV 2018)
Stars: ✭ 51 (-15%)
Mutual labels:  rendering
surface splatting
OpenGL demo of a point rendering and texture filtering technique called Surface Splatting.
Stars: ✭ 125 (+108.33%)
Mutual labels:  rendering
ldview
Real-time 3D viewer for displaying LDraw models
Stars: ✭ 65 (+8.33%)
Mutual labels:  rendering
microbium-app
Draw new worlds
Stars: ✭ 89 (+48.33%)
Mutual labels:  rendering
Legion-Engine
Rythe is a data-oriented C++17 game engine built to make optimal use of modern hardware.
Stars: ✭ 502 (+736.67%)
Mutual labels:  rendering

Crystal Caustics

This project approximate caustics of crystal in real-time using the physically-based caustics rendered offline.

thumbnail

thumbnail

Caustics is a common optical phenomenon that light ray reflected or refracted by an object and created a pattern of light. It usually required track the path of light ray go through the object. However ray tracing is too computationally expensive and can't be done in real-time. This project use pre-render caustics map and light cookie to achieve the approximated effects. See the demo here.

Getting started

  1. Install High Definition Render Pipeline.

  2. Change the setting in the HDRP asset: Lighting > Cookies > Point light cookie size > Resolution 256.

setting

  1. (Optional) Install Unity HDRI pack.

Idea

For each object that has caustics when illuminated, surround it with a mesh bounding box. In the demo I used a icosahedron, but it can be alter to any convex shape. Each vertices of the bounding mesh mapping to one cubemap storing the caustics light.

  1. Render the caustics of target object using photon mapping. To reduce complexity, the light source is limited to one single directional light. Then for each light directions, store the caustics light into a cubemap. The direction is determined by the bounding mesh.

  2. In the real-time rendering, for each light sources calculate the caustics light by interpolate between the caustics cubemap. The interpolatation weight is determined by the barycentric coordinate of the triangle on the bounding mesh hit by the light ray.

Create your own caustics

1. Render caustics map

Use 3ds Max with VRay to render the caustics map to a sphere. You can use spherify modifier on a cube to generate your baking sphere, or simply download my max file (for 3ds Max 2020). The light cookie guide by Pierre desribed the detail about generating Unity ready cubemap in 3ds Max.

Apply VRay material on your object. I suggest using the physical attribute in the real-world for your material. Lookup the index of refraction and abbe number of a material in here.

mlt

An example VRay material setting of Sapphire.

Adjust the VRay rendering setting, including the caustics subdivisions of your light source, max photon number in the global caustics render setting until you satify with the outcome. Add VRayCaustics to render output, use render to texture on each face of the baking sphere to get the caustics.

2. Import into Unity

Assemble each side of the cubemap into one single texture in order. You can use the smart object in Photoshop linking to the rendering outcome to make your life easier.

Import the caustics map into Unity. Change the import setting of Texture Shape to Cube, Format to RGBA 32 bit.

texture import setting

3. Setup caustics

Create a child gameObject for your object. Adding a point light, a mesh collider and the Caustics script to the child gameObject, or your can simply copy the one in the example scene. Apply the caustics map to the cookie cubemap, and then select the light source that affect the caustics.

Requirements

Unity 2019.1.0

  • HD Render Pipeline
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].