Tuesday, March 22, 2016

InstantOC 3.0.0

InstantOC 3.0.0 is out!

It's live on the Asset Store!
Here are the new features in order of coolness:

Culling Group API based optimization for static objects

It's a powerful new optimization that drastically reduces the "popping" effect on distant/sparse/small game objects and improves the overall perceived quality, specially with low Ray Samples.
And low Ray Samples come very handy for CPU-constrained platforms like Mobile and WebGL!
It can be so effective that in some cases you can get really good results with as less as 10 Ray Samples when combined with the "PreCull Check" option.
It's based on the Unity Culling Group API, it can be used with static game objects, that is, objects that won't move, and is fully compatible with procedurally generated objects, and/or dynamically loaded prefabs/objects.
It works in the following way, when an object is instantiated (dynamically or at startup) InstantOC creates a bounding sphere with proper radius and position, and adds it to a bounding spheres array.

Once per frame, before InstantOC fires its Rays, it asks the Unity Culling Group API for a list of bounding spheres that are in the current View Frustum. With this list at its disposal, InstantOC fires 1 Ray for each bounding sphere in this result list, in direction of the bounding sphere (random point on the sphere). This way, there is a high probability of hitting an object with this first shot, drastically reducing blank shots.

After this first run, InstantOC continues with it's Halton Sequence based Ray firing, for culling moving and/or other possible remaining objects.
But thanks to this highly effective first run, the Ray Samples needed for the Halton Sequence are now far less.

To use it, add manually the "IOClod" script to your Game Object and enable the "Static" option on the IOClod script inspector panel.

Unfortunately, I have yet to find a way to read the "Static" value of the main inspector section at run-time.

Automatic Lod Margin

Finding the sweet-spot for this value was rather an ethereal undertaking.. now you don't need anymore to fiddle around with it. InstantOC 3 will do the magic.
If needed, you can always override the automatic value by setting it in the "IOClod" script options.
Just to refresh your memory, the right Lod Margin avoids the annoying "flickering" between LOD levels when approaching the switch distance.


Infinitely deep GameObject hierarchy

Prior to version 3, InstantOC needed you to setup your GameObject hierarchy in a certain way, that is, the collider(s) needed to be either on the same GameObject with the "IOClod" script, or on a direct child(s). Now, when a ray hits an InstantOC managed collider, it recursively searches for the "IOClod" script upwards. A whole new level of flexibility for your GameObjects hierarchy and far easier setup!

That's all folks! Hope you'll enjoy this update.

PS: 4 LOD levels didn't make it in time for this one, but stay tuned :-P

Wednesday, September 23, 2015

Splashy Flipper

Hey there,
couple of weeks ago, I finally released my first game made with the Unity engine, it's called Splashy Flipper and it's inspired by the simple game mechanics of Flappy Bird. Though I tried to add some new elements to the gameplay.
You can play a free WebGL version here, and if you like it, maybe you can buy one of the Stores versions, or make a little bitcoin donation!
The great Mirkojax was so kind to make a video review, thank you Mirko!

Here is a Twitch of me beating the World-record (it has already been beaten again...)

I'll realize a series of "making of" posts, explaining in detail how Splashy Flipper was made, with lots of code samples, describing all the catches I encountered during this amusing journey and the solutions I came up with.
The sum of this posts will be a fairly detailed tutorial on how to make a Flappy Bird like game with Unity.
Stay tuned!

Wednesday, January 21, 2015

Monday, January 19, 2015

InstantOC 2.1.0

So there we are, v 2.1.0 has been finally published!
Should be online on the Asset Store within 3-5 days.
There are some long awaited new features and of course the unavoidable, standard, bug-fixing/cleaning stuff.
Let's see them in detail:

Terrain Occlusion Culling
InstantOC now supports Unity Terrains occlusion culling, this means, if you have multiple terrains, occluded ones won't be rendered. You will have to slice your big terrain into multiple pieces with some tool (like this one), or create it from scratch in pieces like this other tool does.
As before, game objects hidden by hills or mountains, won't be rendered as well.

Occludee Support
Now you can mark transparent objects as occludees; occludees don't occlude other objects, but get occluded by other objects; so if you have a transparent object behind a wall, InstantOC will not render it, but if you see through this transparent object, InstantOC will render any object behind it.
For this to work, you will have to create a layer that will be used automatically by the system, and choose it from the main IOCcam panel. Don't put occludees or other stuff on this layer, InstantOC will use it automatically!

Multiple TAGs Support
This one was asked many times on the thread, it took a while, but it's finally here :-)
Now you are no longer forced to TAG your objects with a specific TAG to use them with InstantOC.
You have the flexibility to enable InstantOC without changing your TAGs setup.
As before, you can always skip the TAG autosetup and add manually the IOClod/IOCterrain/IOClight scripts to your game objects.

PreCull Check Support for lights
This powerful optimization that drastically reduces "flickering" of small and/or distant objects, is now available also to lights occlusion culling. When enabled, distant lights managed by InstantOC won't flicker any more.
A little reminder about PreCull Check: if enabled in editor with multiple views (game + top for instance), the results while playing are unpredictable, it's perfectly fine, it works as expected in full-screen preview and final builds. It's due to the "IsVisible" property of the Unity "Renderer" component, it returns true if a renderer is visible on any active camera/view while playing.
So if you want to check occlusion culling while in editor preview with multiple views, disable PreCull Check, but remember always to enable it for your builds!

Bug-fixing and refactoring
The bug-fix described in the previous post has been obviously included in this update, and some initial code refactoring has started. This will eventually lead to version 3.0.0, which will be much more modular and extensible and offer a greater compatibility with the excellent QuickLOD from Chillersanim. A simple API will emerge, to delight the coding users and enable even deeper control on InstantOC.

Saturday, January 18, 2014

InstantOC 2 bug hunting

Just tried InstantOC 2 with the cool FPS controller Prefab included in the new Unity Sample Assets, there is a little bug preventing the "PreCull Check" option to function correctly.
To both support the old FPS controller Prefab and the new one, simply change line 148 in the "IOClod" script from this:
if(h.transform.tag != iocCam.tag)

to this:

Will submit bug-fix release to the Asset Store in a couple of hours.
Btw, the new Sample Assets are really cool!

Friday, January 17, 2014

InstantOC 2.0.0 live on the Asset Store!

InstantOC 2.0.0 is available on the Asset Store, it will maintain the old price (15$) for 15 days, after that, it will be priced 25$.
So hurry up and get your license until it's in promotion!

In the previous post, the details about this juicy update :-)