- Home /
Island Demo Trees
I'm new to Unity. I was experimenting with the Island demo. In the compiled game/Game tab all the trees glow. The glows go through everything but only appear at a certain range. I have a compiler error that says: Shader warning in 'Hidden/Grayscale Effect': Upgrade NOTE: SubShader commented out because of manual shader assembly at line 10
Answer by jashan · Oct 08, 2010 at 05:52 AM
This is a known issue with the Island Demo and Unity 3. Not sure if this didn't get fixed for release but seemingly not. Look for the file Scripts/UnderwaterEffects.js
And make sure to disable the glow on startup (e.g. in Awake() or Start()) by saying
glow.enabled = false;
Here's the full modified Awake() method:
function Awake() { if(!waterLevel) { water = FindObjectOfType(Water); if(water) waterLevel = water.gameObject; } aColor = RenderSettings.fogColor; aDensity = RenderSettings.fogDensity;
glow = GetComponent(GlowEffect);
blur = GetComponent(BlurEffect);
if( !glow || !blur )
{
Debug.LogError("no right Glow/Blur assigned to camera!");
enabled = false;
}
if( !waterSurface || !underwaterSurface )
{
Debug.LogError("assign water & underwater surfaces");
enabled = false;
}
if( underwaterSurface != null )
underwaterSurface.enabled = false; // initially underwater is disabled
if (glow)
glow.enabled = false;
}
Also, you need to manually switch off the GlowEffect which is attached to First Person Controller Prefab/Main Camera (in the Hierarchy).
Finally, there's still a problem when you leave the water: The glow isn't switched off correctly. Not sure why this worked in 2.6 and doesn't in 3.0 ... but to fix it, replace glow.enabled = !below with glow.enabled = below twice in Upate(). So it looks like this:
function Update () { if (waterLevel < transform.position.y && below) { Debug.Log("Leaving water"); audio.clip = aAudio; audio.Play(); RenderSettings.fogDensity = aDensity; RenderSettings.fogColor = aColor;
below = false;
glow.enabled = below;
blur.enabled = below;
waterSurface.enabled = true;
underwaterSurface.enabled = false;
}
if (waterLevel > transform.position.y && !below)
{
Debug.Log("Entering water"); audio.clip = uAudio; audio.Play(); RenderSettings.fogDensity = uDensity; RenderSettings.fogColor = uColor;
below = true;
glow.enabled = below;
blur.enabled = below;
waterSurface.enabled = false;
underwaterSurface.enabled = false;
}
}
The "SubShader commented out" is a message you get with many shaders that are auto-converted from Unity 2.x to Unity 3. Not sure if the Island Demo will eventually be updated but I guess not, so at this link you will probably find the old demo which needs a few fixes to work properly with Unity 3.
Thanks for the response, I've looked all over and can't find the glow.enabled code. I have managed to get rid of all compiler errors except I still cant find the glow. Do you have any Idea what i'm doing wrong?
The code mentioned is in Scripts/UnderwaterEffects. I've also edited the answer to be much more detailed. That should make it easy to fix it.
Answer by T3Kaos · Feb 01, 2011 at 10:33 PM
I followed the instructions and found that it works so to make it easier for everyone I have created a modified version of the original Island Demo stored on my server for you to download.
You can download it from http://z01.co.uk/downloads/island_demo.zip. This compressed folder is the original Island Demo modified using the above instructions to work with Unity 3.
Please somebody upload that modified version! I need it so much!
I guess only a few people have downloaded the zip. The best bet would be that @T3$$anonymous$$aos will reupload it somewhere else. But since he registered on the same day this post was done and he hasn't been online since then, i guess we will never see him again ;)
Do you have it? Would you care to upload it? Also, did you actually manage to make it work? If yes, is there any chance you could upload the project, or list the required steps?
Answer by TNordmark · Feb 21, 2012 at 08:45 AM
I cant get this to work! I still got the message (Assets/Scripts/UnderwaterEffects.js(23,38): BCE0022: Cannot convert 'UnityEngine.GameObject' to 'float')
I have even try to change water.gameObject; to water.gameObject.transform.position.y
but still not working...
var waterLevel : float; var uAudio : AudioClip; var aAudio : AudioClip;
var uColor = Color(1,1,1,1); var uDensity = .05;
var aColor = Color(1,1,1,1); var aDensity = .008;
var waterSurface : Renderer; var underwaterSurface : Renderer;
private var below = false; private var glow : GlowEffect; private var blur : BlurEffect;
function Awake() { if(!waterLevel) { water = FindObjectOfType(Water); if(water) waterLevel = water.gameObject; } aColor = RenderSettings.fogColor; aDensity = RenderSettings.fogDensity;
glow = GetComponent(GlowEffect); blur = GetComponent(BlurEffect); if( !glow || !blur ) { Debug.LogError("no right Glow/Blur assigned to camera!"); enabled = false; } if( !waterSurface || !underwaterSurface ) { Debug.LogError("assign water & underwater surfaces"); enabled = false; } if( underwaterSurface != null ) underwaterSurface.enabled = false; // initially underwater is disabled
if (glow) glow.enabled = false;
}
function Update () { if (waterLevel < transform.position.y && below) { Debug.Log("Leaving water"); audio.clip = aAudio; audio.Play(); RenderSettings.fogDensity = aDensity; RenderSettings.fogColor = aColor;
below = false;
glow.enabled = below;
blur.enabled = below;
waterSurface.enabled = true;
underwaterSurface.enabled = false;
}
if (waterLevel > transform.position.y && !below) {
Debug.Log("Entering water"); audio.clip = uAudio; audio.Play(); RenderSettings.fogDensity = uDensity; RenderSettings.fogColor = uColor;
below = true;
glow.enabled = below;
blur.enabled = below;
waterSurface.enabled = false;
underwaterSurface.enabled = false;
}
}
Answer by Shadow1918 · Jan 08, 2013 at 12:36 AM
Main Camera, Glow affect, Glow tint, choose black. DONE!!
Answer by Graham-Dunnett · Jan 23, 2013 at 04:10 PM
Importing Island Demo into Unity 4.0.0f7
Get the project from http://unity3d.com/support/old-resources/files/IslandDemo.zip (which is a 150M file)
Unzip
Open in Unity
Choose fix now at the pragma strict warning
Note the GUID cache rebuilding, script compile warnings and error, FBX import warnings and shader warning in the log (just ignore for now)
Click fix now at the NormalMap settings warning
Fix the error in UnderwaterEffects.js as per the answer from Jashan
Comment out lines 13 and 31 of UpdateTreeColors.js
Change the way that Glow is handled in UnderwaterEffects.js, again, as per Jashan
Switch to the Islands scene
Press run
Note, this should give a demo that runs. I've not looked into the various shader and asset import issues, so it's highly likely that they'll be problems in the demo. But it starts up and you can run around and do stuff.
Your answer
Follow this Question
Related Questions
Tree Creator Problems 1 Answer
How do I get a speedtree color? 0 Answers
How do you update the hidden tree shaders? 0 Answers