Web player and shadows.

I am upset. One year ago, I persuaded my employer to purchase Unity3D and the Flash module for USD 3,000 in order to make maritime educational simulators. Meanwhile Flash is no longer supported so I had to go for the Unity Web Player but I have still no product worth distributing. Here is an example of my headache:

Making a ship’s bridge object, moving on a maritime scenery, the shadows are shown through the “roof” as triangles. Since the ship’s bridge moves on the water, the “triangles” move along too.

In any case, when I build it for the Web Player, it doesn’t show any shadow at all! Here is what I do:

  • I use Unity3D 4.2.2 PRO.
  • The light is directional, resolution to Very High, Render Mode to Important. (doesn’t work either with resolution as Use Quality Settings when that setting is set to Fantastic.
  • Quality setting is set to Fantastic and the directional light follows the ship so the Shadow Distance of 150 meters shouldn’t be a problem.
  • Player setting with Render Path Forward or Deferred Lighting doesn’t make a difference.

The shadows are visible in the Editor and in a test Windows .exe version of the project. But not in the Web Player. In fact, not only the shadows but the quality of the water texturing in the Web Player correspond to that of the Fastest Quality Setting, not the Fantastic it is set to. As if the Quality Settings are overridden when built for the Web Player.

The other issue, the “triangles” effect of the shadows, results as such: A simple cube made in Blender as the ship’s external walls. A smaller cube with “flipped Normals” to make the walls inside the bridge. Then three “boolean difference” to punch three portholes in the walls of the ship. Nothing more, nothing fancy. Yet, the shadows come as triangles along the surface of the walls, near the roof.

Shadows and the feeling of the direction of the sun is very important for any navigator and if this is going to be used for the training of seafarers, I need to get it right.

Could someone help me, please?

Cordially,
Michel Verheughe
Seagull AS, Norway

Do you have a screenshot or a webplayer demo that we could look at so we can see exactly what it is you’re describing?

Of course, Dustin, and thank you for answering my message.
The link is:
http://home.online.no/~michel/Seagull/Unity%20Keyboard.html
Then select the Pilot Launch button and compare what you see to this screenshot of the Editor at the same start-up view.

On the screenshot, you can see the “triangles” and also that the sea looks different than with the Web Player.

Thank you,
Michel

First suggestion… add a cruise ship with some sun bathers to make those binoculars more fun to use. :slight_smile:

Ok, sorry for the bad joke. I see the differences as well. There isn’t a huge difference in the water, but it certainly looks “flatter” in the web player. I also noticed when I go fullscreen that everything looks very pixelated…

I did some testing in 4.2.2 myself and shadows are working fine for me so is it possible that it’s a shader issue? I don’t have a lot of inisight but hoping someone else can jump in. Here are screens of the WebPlayer, directional light settings and web settings:





Ack sorry for all of the image attachments… they weren’t showing up for some reason and now they’re showing up duplicated and I can’t get rid of them.

Thank you, Dustin. Obviously I must be doing something wrong but I don’t know what. My settings are the same as yours. I don’t think a shader could be the problem because, for the ship, I use exclusively the Diffuse shader.
The project has two challenges. First, I need to have a moving object (the first person) inside another moving object (the ship). Secondly, I need to see objects as close as 30 cm from the first person and 20 km away from it, to show distant shores and vessels. The camera frustum is then from 30 cm to 20 km and that’s a big one!

My last challenge is that … I am 65 years old! :frowning: I will retire next year, unless … this project has a future. In which case, I’ll work on it until my employer kick me out! :smile:

Hmm… I wonder if distance would cause an issue with the shadows… I just don’t know enough about how they work.

As for your first challenge… just make the boat the parent object of your first person object… then you don’t have to worry about it. I think the boat moving will naturally move your first person character as well because the character’s transform will be relative to the transform of the boat.

No, the distance isn’t the problem, Dustin. I have tested it with much shorter distance, to no avail. For the “moving object on a moving object,” indeed I make the first person a child of the vessel. But I can’t use Physics because if I do, by moving the first person forwards, to a collision with the walls, it pushes the ship forwards. I know, I can change the Ridigbody’s Mass but not to the scale of a human being vs. a bulk carrier of 500,000 tons! :slight_smile:

But this problem of shadows in Unity Player is really irritating me. We purchased the program for USD 3,000. Doesn’t that give me the right to ask an question to the Unity developer’s team? Do you know how I do that?

I was hoping that someone else with more knowledge would jump in and help out… I’m stumped. I think your best bet would be to send an email to support:

support@unity3d.com

Hopefully they’ll have a better answer for you. Expect a day or so to get a response but it may come quicker.

Thanks Dustin, I will do that.
Best regards from Norway.
Michel

You’re very welcome and good luck! Also, when you get it figured out could you post the answer here? I think it would be useful if anyone else runs into the same issue. I know most folks just repost instead of using the search function, but at least some may pick it up. :slight_smile:

I certainly will, Dustin. I have found so much from reading other’s answers that it is only fair that I try to help others, if and when I can.
So far, I have come to this:

  • The problem of the “triangulation” of the shadows seem to be related to the other objects I have around because if I remove entirely the scenery (the islands, the sea, etc) and keep only the ship, the instruments and the first person, the triangles are gone.
  • For the Unity Player not showing the shadows at all, I have reduced everything to simply the ship’s hull, as a .fbx from Blender, the main camera and a directional light. It still doesn’t work. But if I start from a brand new project, set a simple “window” .fbx from blender, with a camera inside it, it works!
    … I can’ figure out what is wrong. But it will be raining, this week-end, in Norway, and I’ll spend much time in front of my computer, trying to solve this, instead of doing what I like best: flying my little aircraft! :wink:

Hi Michel, have you tried adjusting the Quality Settings for the webplayer?

Go to Edit > Project Settings > Quality and change the settings and the default there. For the faster settings shadows get disabled.

Hello Schubkraft and thank you for your answer. My Quality Settings is set to the highest, Fantastic. I am now sure that the problem resides with the Library and/or ProjectSettings folders. This is because I managed to delete everything but a light, a camera and the hull of the ship. I started then a new project with exactly the same configuration of light, camera and hull of the ship. All setting for quality, etc. are exactly the same. The size of the Assets folder is the same for both projects. Yet the new one shows shadows in Unity Player and the old one doesn’t. It can only result from what is different: the content of the Library and/or the ProjectSettings folders.

Regards,
Michel

Out of two problems, one is solved: the “triangulation” of the edge of the shadow area. In addition to the terrain (land and sea) I have an object that is, the buildings, including those in the departure harbour and those in the distant destination. Making it two different objects, each as a smaller group of houses, solved the problem. I suppose then that the calculation of the object receiving and sending shadows was much too large to give a smooth edge.

Second problem: the failure to display shadows in the Unity Player … not yet solved and waiting an answer from support@unity3d.com

Might be a silly answer as i’m just starting and had the same problem with shadows. But look at this link below - search for the bit on ‘Rendering Path’ as it talks about shadows only working on unity player with ‘deferred lighting’ which is a unity pro only feature.

http://docs.unity3d.com/Documentation/Components/class-PlayerSettings40.html

Not sure if that helps.

Thank you for answering this old post. My problem is solved now and yes I have Unity Pro! :wink:

How was your problem solved?? I am having a similar issue ;(

I had a very large object, the landscape itself. If I don’t select Cast Shadows and Receive Shadows for that Mesh Renderer, it works fine.

Does this still occur if you remove the other quality setting profiles, leaving only fantastic?