Lampflower Forest Project

A recreation of the 'Lampflower Forest' zone from Square's Secret of Mana 3 for the SNES.
Featuring development from Revised Concept to Completion, Procedural Texturing, and Real-Time Lighting that's been optimized for Mobile through the use of Shader & Tool Programming.

Target Device: Samsung Note 10
-
Android OS 4.4 (KitKat)
-
Qualcomm Snapdragon 855
-
8MB RAM


Modeling: Organic
Leaves and campanulate-shaped flowers in various states of bloom created in 3DS Max.

Custom Shader programming


HLSL
Flower Shader
-
2-sided
-
Emissive Map & Emissive Color Map
-
Indirect Light Color Map
-
Real-time Lighting Metapass
Glowing shader used for the Flowers, which is the main Light Source in the scene. Aided by a C# script that animates/updates the lighting.
Leaf Shader
-
2-sided
-
Colored Specular Blinn-Phong
-
Receives Real-time Lighting
-
Receives Directional Lighting & Shadows
Diffuse shader used for Vegetation, which receives the Flower Shader's light. A Blinn-Phong shading model, made to receive Realtime Lighting.
Code Snippet of Custom Shader: Flower
Code Snippet of Custom Shader: Leaf


Single Copy / Paste

Multiple Copy / Paste

Options


Editor Tool:
Copy Realtime Lightmaps
-
Editor-Mode Realtime Lighting Update
-
Realtime Light Source display via Icon
-
Single Copy/Paste Realtime Lightmap
-
Batch Copy/Paste Realtime Lightmap
-
Colored Highlights to identify copies
-
Supports Multiple Selections & Children
-
Combines copies to a single Object
C# tool that helps the User visualize and execute copying Realtime Lightmaps from one Object to another.
Code Snippet of Editor Script
Code Snippet of Main Logic Script


Optimization
My optimization strategy only combined Objects with similar lighting, while Batching combined freely. This meant more Objects, which created more DrawCalls. However, it also had far less Lit Objects. Less Lit Objects, meant less time spent on Lighting, and less Texture Space needed. This was a DrawCalls for Lighting Calculation tradeoff, which halved CPU time.


Optimized

Full Lighting
Optimized
Un-Optimized
Some meshes are lit, lightmaps are copied to unlit & combined via Script
All meshes are lit & combined via Batching
-
60 FPS
-
72 Drawcalls
-
26.3MB Cache
-
1 Resolution
-
26-37 FPS
-
33 Drawcalls
-
160.4MB Cache
-
2 Resolution
Strategy for which Realtime Lightmaps were copied, and which of the glowing Flowers were contributing to Realtime Lightmapping.
Optimized
-
49 Lit Objects
-
3 Lightmaps
-
19 LightSources
Un-Optimized
-
259 Lit Objects
-
123 Lightmaps
-
40 LightSources
Redesigned corner to minimize polygon density and reduce the number of Light Sources to manage.

Trimmed number of Flower models from 4 to 3. Reduced needed Texture Space & Drawcalls, but kept the variety from the original.
Problem Solving

Changed layout from Square to Rectangle to suit the change from CR-TV to CellPhone.
The Original's Sprites were re-used in a repetitive way, that modern Model re-use avoids with rotation/scale. Revision could address this, but would that hurt nostalgic appeal? I kept the repetitive layout, 'breaking it up' with stray leaves. I also added dead leaves and dying grass because repetition which might seem 'Landscaped' to modern eyes.
The Original's underbrush fades into obscuring darkness, however the Revision's flowers cast light onto their surroundings. In order to avoid floating leaves and flowers, I added stems. The Original's leaves have curly charm, however the Revision loses this re-using a leaf model. In order to recapture this, the stems were made curly.