• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by The N00B · Oct 07, 2010 at 09:23 PM · treetreesisland-demo

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

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

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 &gt; transform.position.y &amp;&amp; !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.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image The N00B · Oct 15, 2010 at 01:49 AM 0
Share

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?

avatar image jashan · Oct 15, 2010 at 12:07 PM 0
Share

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.

avatar image The N00B · Oct 17, 2010 at 09:11 PM 0
Share

Thank you so much!!!

avatar image
0
Wiki

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.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TNordmark · Feb 21, 2012 at 01:56 AM 0
Share

(404 Page Not Found) Can you upload it again?

avatar image NickolasTheGreek · May 04, 2012 at 08:21 PM 0
Share

Please somebody upload that modified version! I need it so much!

avatar image Bunny83 · May 04, 2012 at 09:25 PM 0
Share

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 ;)

avatar image NickolasTheGreek · May 05, 2012 at 07:19 AM 0
Share

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?

avatar image
0

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;

}

}

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Shadow1918 · Jan 08, 2013 at 12:36 AM

Main Camera, Glow affect, Glow tint, choose black. DONE!!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Graham-Dunnett · Jan 23, 2013 at 04:10 PM

Importing Island Demo into Unity 4.0.0f7

  1. Get the project from http://unity3d.com/support/old-resources/files/IslandDemo.zip (which is a 150M file)

  2. Unzip

  3. Open in Unity

  4. Choose fix now at the pragma strict warning

  5. Note the GUID cache rebuilding, script compile warnings and error, FBX import warnings and shader warning in the log (just ignore for now)

  6. Click fix now at the NormalMap settings warning

  7. Fix the error in UnderwaterEffects.js as per the answer from Jashan

  8. Comment out lines 13 and 31 of UpdateTreeColors.js

  9. Change the way that Glow is handled in UnderwaterEffects.js, again, as per Jashan

  10. Switch to the Islands scene

  11. 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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

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

Tree billboards clipping into terrain 1 Answer

Where to find/How to make tree materials 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges