While working on a map i came across an engine limitation. I found out that transparent objects do not support lighting.
Fortunately theres an alternative, using cutout shaders.
This shader supports semi-transparent shadows via dithering. (faked transparency)
This dithering can also be used to create a “retro” effect
Additionally, since its an opaque shader, transparency sorting wont be an issue. (like things popping in and out of order in certain views)
Greenscreening was tweaked to work a little better with semi-transparent color keying. This was important because the video player being used does not support transparency.
Greenscreen works on most shaders. (except “lighting” shaders)
*Added Character Cutout Shader
This shader only works correctly with a character billboard (rotating around the y axis). The main point of it is to make sure the poster receives lighting from the front and back.
This is the closest i could get it without having to rewrite an entire custom lighting solution.
Problems with it:
Lights are sometimes cut-off (less accurate lighting than using a lit standard shader)
Sometimes its too bright compared to the environment.
*Added shader selection window
I needed to add this because the tiny dropdown window was getting long and hard to read.
Works on posters and materials
*Added softshadows
Since shadows are important now that lights are in the game. I made the default shadow type soft. That way it makes “semi-transparent” dithered shadows look better.
*Added Vertex snapping global toggle
To simplify shader selection, i made the vertex snapping a global toggle.
Whenever you set a poster to be displayed on the screen in any way, vertex snapping will automatically be turned off for that poster and the surrounding frames.
*Scrapped the idea of a resource limit for now
There are a lot of possible optimization fixes technigues that havent been added yet. Additionally newer versions of unity optimize things better. This will be worked on later
*Added “Allow URL Media” option
More websites are cracking down on website scraping. its not the same internet as it was 10 years ago. The new ZIP file map mechanic feels better than worrying about
urls being taken down.
*Changed the main font of the game
The new font allows for case sensitive stuff. It makes events and dialogue a lot easier to read IMO.
Top -> new
Bottom -> old
*Added a “child index” variable to entities
I forgot to add this when i was working on parent/child hierchy mechanic. This had to be added because the path entity relies on the child order.
The game has no hierchy inspector but if its ever needed in the future, it will be easier to add.
*Poster viewing
Added a “fadeTime” parameter to the “ViewPoster” event.
Added OnViewPoster event.
This event triggers the moment a poster becomes visible. Very useful since you dont have to add a delay.
“Delta” view mode:
Made it so that input keys smoothly lerp the camera around the image
Made it possible for the player to use the mouse to move around the image
*Wheel picker event icons
Instead of creating a unique icon for each event (and making the wheel hard to read). I thought using a unique icon to group event types to be easier to read
*Misc
Finished that long bug list.
Made posters cast shadows from both sides. (instead of just one side)
Made the game preserve old maps(mostly)
Re-added the old standard shader… (i had a hard time trying to imitate the colors of old maps). This shader is not selectable in the shader window.
When an old map is loaded, [OnClick -> PlayPosterVideo] event will be added to any posters that have a video on them.
Some things like the video on/off sounds will not play anymore. But that shouldnt destroy the vibe of old maps too much.
Replaced some of the sliders with input values. (poster size, scroll speeds). Things that i thought a slider with a min/max would impose an annoying limit on.
Made the sound when coming out of fly mode more quite and shorter
Lots of other things too much work to note
*What to work on next
That long list of bugs was finally completed, but there are a few things i would like to try to make the editor feel better.
Try to implement the ability to use posters as materials. (custom material/posters -> posters only)
Add adjustable post processing effects: (bloom and depth of Field)
Make my own rendering solution: not sure if this one is worth it just to fix issues with the character cutout shader.
By the time the next blog post comes out, there is a high chance the new features will be ready map creation. (beta branch soon maybe)