Friday, 14 October 2011

Dissapearing lights Frustrum Fix

For those having overactive culling of your lights here is a temporary script to fix it. Just create a new file called ExpandRenderBox.cs and copy paste this code in. Add this to your lights.
Edit: Fixed a semicolon.

using UnityEngine;
public class ExpandRenderBox : MonoBehaviour {

    public float boundSize = 1000;

    private void Start () {
        Mesh mesh = GetComponent<MeshFilter>().mesh;

        Vector3[] verts = mesh.vertices;
        int origCount = mesh.vertexCount;
        System.Array.Resize<Vector3>(ref verts, origCount + 2);

        Bounds bound = new Bounds(, * boundSize);

        verts[origCount] = bound.min;
        verts[origCount + 1] = bound.max;

        mesh.vertices = verts;


    private void OnDrawGizmos()
        Gizmos.DrawWireCube(transform.position, * boundSize);

Monday, 26 September 2011

Thursday, 15 September 2011

V-Lights System

VLights volumetric light system allows you to have true volumetric lights that can have shadows, animated noise, color patterns and much more in Unity3D.