Author Topic: Shoreline Object stays black  (Read 6009 times)

bumbummen

  • Newbie
  • *
  • Posts: 9
    • View Profile
Shoreline Object stays black
« on: September 25, 2017, 02:13:42 PM »
Hey,

i have got my hands on a copy this beautiful asset by a colleague who bought it during the sale. I was playing around with it and tried to integrati it into my project but i did notice some bugs along with my setup. I have bought the asset now and wanted to continue intigration, hoping the problems are specific to 2.1.3, but as it turned out they are also in the store version.

First off, the advanced demo scene is working fine. The shoreline object shows the "depth map" as intended and the cameras are working fine.
But in my scene i have the following problems (Screenshots below):
  • The shoreline object just stays black. With 2.1.3 i was able to get it to display at least a kind of border of the terrain but now it is not working at all.
  • The water reflection cam (im pretty sure its this cam) is rendering its image into my Inventory camera (see below)
  • Changing cameras does not work, my FP cam is always under water, the third person cam is working fine.

I have played around with the shoreline object by changing its parameters or it's size but i was unsuccessful with that. I have read that i could possibly be a problem with my terrain shader (CTS) but also CTS is stated to be compatible in some old post i have found. Next to that i have set up a method that is setting the manualCamera to the actual camera and tracker, to null (so tracker can update in Suimono_CheckCamera()) in the Suimono_Module class, each time the player is changing the view (the other camera gets disabled after changing the view) and i have noticed the following:
The first person camera has the underwater effect applied to it at any time (also after changing the cameras). As stated above the third person cam is just working fine. Booth are identical camera setups.

Also i am not getting behind my problem with the reflection cam output being written into my inventory camera image (it just does not make sense at all...). I have checked the culling masks of each cam to get around this but it seems like it is not a culling problem at all. I hope that you can help me and that i have explained my problems understandable (I am not a native english speaker). I am also using a modified version of the Survival Multiplayer Asset (https://www.assetstore.unity3d.com/en/#!/content/84298), Advanced Foliage Shader v5 and CTS if that helps.

Screenshots

As you can see, the camera image is written into the inventory camera. I were able to work around this by adjusting the culling mask but there is still a little line of the camera image on the bottom. Except of the inventory, everything is working fine.


Now, in first person view, the camera is always underwater. Sometimes, the effect disappears (with water going down the screen as intended) to re-appear half a second after.


Also some black shore line object. This one is using the defualt settings and i have found no way to get it to work.

This asset is really the best solution by the features it offers and work and research it contains for that price. I would appreciate if you can help and if you had similar problems in the past with a setup/asset mix like mentioned above.

Best Regards
Patrick

bumbummen

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Shoreline Object stays black
« Reply #1 on: September 25, 2017, 02:45:44 PM »
Also i have noticed that there are no order numbers for my more recent asset store purchases (i have read about this but i have also contacted support right now). How can i register my purchase otherwise? I have the paypal confirmation mail and bill number.



Best Regards
Patrick

Chingwa

  • Administrator
  • Hero Member
  • *****
  • Posts: 1704
    • View Profile
    • Tanuki Digital
Re: Shoreline Object stays black
« Reply #2 on: September 25, 2017, 04:01:02 PM »
Hi Patrick,

Many thanks for your purchase and kind words regarding Suimono.  I'm glad to hear you're happy with it.  I'm not 100% sure about the cause of some of these issues but I will give some notes below that might help...

Shoreline object... One of the changes from 5.1.3-->5.1.4 was the inclusion of the 'max depth range' setting on the shoreline object.  This setting allows better shoreline resolution steps by limiting the depth (in meters) of the shoreline capture, and should be as low as possible for your scene, though the default of 12 is usually sufficient.  However, this also affects the threshold in the Depth Range and Shore Range sttings, so these may need to be adjusted up or down accordingly after setting what your max depth range should be.

That being said, if you just get black regardless of the settings you use, than it could possibly be an issue with the terrain shader.  I would recommend doing a test where you put a large cube or other shape underneath the water using the default Unity Standard shader, just to see if the shoreline generation picks that up.  If it sees the box and not your terrain then you might try temporarily switching to the default Unity terrain shader instead of CTS.

One of the problems I've seen in the past with CTS was that, for some reason (and only in some particular circumstances) the depth generation was somehow failing... which had contributed to the shoreline not generating.  The solution in that case was to change or add a proper fallback to the end of the CTS shader that was used... Fallback "Diffuse".  This fallback does some magic stuff behind the scenes in Unity (unfortunately) and any time I've seen a weird issue with a Shader adding the fallback "Diffuse" line has very often fixed it.

As for some of the other issues you're seeing with cameras, I recommend setting Suimono to Automatic camera mode.  This mode will always track the camera set to 'MainCamera' tag.  Make sure that your main scene camera has the 'MainCamera' tag set, and that all other cameras are untagged.  Then when switching cameras between third and first person, you should write a method that a) turns off the MainCamera tag on the old camera, and b) turns on the MainCamera tag on the new camera in that order.  When Suimono is then set to 'Automatic' camera mode, it should then keep up with the camera changes (as long as you have the correct camera tagged with 'MainCamera').  Any other cameras in your scene (such as possibly a third camera for the inventory camera?) should be marked as untagged always... or at least they shouldn't have the maincamera tag or Suimono might get confused.

I'm not sure why you would have a box in your inventory view... it seems like changing the culling layers should fix that issue... like it should only render your inventory character layer.  Are you sure there aren't any other objects in that area or in your UI that might conflict somehow?

I'm not sure why the asset store Purchase Numbers are showing up blank, but it's not the first time I've seen this.  It seems to have started around the beginning of the summer when they switched their number formatting around.  I did bring it up to the Asset Store at the time, I can't believe it's not fixed yet :(  Did you receive an email with an Asset Store invoice when you purchased?  There might be other numbers listed their that I can use to confirm purchase.  Feel free to email me directly at konnichiwa@tanukidigital.com

Let me know if the above helps or if you still run into any trouble.

-Justin Kellis
Tanuki Digital


onephpmastermind

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: Shoreline Object stays black
« Reply #3 on: September 25, 2017, 06:23:14 PM »
Hey,

i have got my hands on a copy this beautiful asset by a colleague who bought it during the sale. I was playing around with it and tried to integrati it into my project but i did notice some bugs along with my setup. I have bought the asset now and wanted to continue intigration, hoping the problems are specific to 2.1.3, but as it turned out they are also in the store version.

First off, the advanced demo scene is working fine. The shoreline object shows the "depth map" as intended and the cameras are working fine.
But in my scene i have the following problems (Screenshots below):
  • The shoreline object just stays black. With 2.1.3 i was able to get it to display at least a kind of border of the terrain but now it is not working at all.
  • The water reflection cam (im pretty sure its this cam) is rendering its image into my Inventory camera (see below)
  • Changing cameras does not work, my FP cam is always under water, the third person cam is working fine.

I have played around with the shoreline object by changing its parameters or it's size but i was unsuccessful with that. I have read that i could possibly be a problem with my terrain shader (CTS) but also CTS is stated to be compatible in some old post i have found. Next to that i have set up a method that is setting the manualCamera to the actual camera and tracker, to null (so tracker can update in Suimono_CheckCamera()) in the Suimono_Module class, each time the player is changing the view (the other camera gets disabled after changing the view) and i have noticed the following:
The first person camera has the underwater effect applied to it at any time (also after changing the cameras). As stated above the third person cam is just working fine. Booth are identical camera setups.

Also i am not getting behind my problem with the reflection cam output being written into my inventory camera image (it just does not make sense at all...). I have checked the culling masks of each cam to get around this but it seems like it is not a culling problem at all. I hope that you can help me and that i have explained my problems understandable (I am not a native english speaker). I am also using a modified version of the Survival Multiplayer Asset (https://www.assetstore.unity3d.com/en/#!/content/84298), Advanced Foliage Shader v5 and CTS if that helps.

Screenshots

As you can see, the camera image is written into the inventory camera. I were able to work around this by adjusting the culling mask but there is still a little line of the camera image on the bottom. Except of the inventory, everything is working fine.


Now, in first person view, the camera is always underwater. Sometimes, the effect disappears (with water going down the screen as intended) to re-appear half a second after.


Also some black shore line object. This one is using the defualt settings and i have found no way to get it to work.

This asset is really the best solution by the features it offers and work and research it contains for that price. I would appreciate if you can help and if you had similar problems in the past with a setup/asset mix like mentioned above.

Best Regards
Patrick

You need to make sure the setCamera is correct, use manual camera settings and if your camera is being created at realtime make sure to update the module script with your set camera.

If there is some sort of issue with your terrain shader and the suimono system you can completely separate suimono and the terrain by using a multiple camera system and rending the water to one camera and the terrain to another. This actually give you much more control over what you can do with his system without any glitches ;)



        moduleObject = GameObject.Find("SUIMONO_Module").gameObject.GetComponent<Suimono.Core.SuimonoModule>();
                moduleObject.setTrack = t.gameObject.transform;
                moduleObject.manualCamera = t.gameObject.transform;
                moduleObject.setCameraComponent = t.gameObject.GetComponent<Camera>();
                moduleObject.mainCamera = t.gameObject.transform;

     
« Last Edit: September 25, 2017, 06:25:06 PM by onephpmastermind »

onephpmastermind

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: Shoreline Object stays black
« Reply #4 on: September 25, 2017, 08:51:28 PM »
I'm not sure why you would have a box in your inventory view... it seems like changing the culling layers should fix that issue... like it should only render your inventory character layer.  Are you sure there aren't any other objects in that area or in your UI that might conflict somehow?

He could render his UI to a separate camera as well.

bumbummen

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Shoreline Object stays black
« Reply #5 on: September 26, 2017, 12:01:30 PM »
Hi Patrick,

Many thanks for your purchase and kind words regarding Suimono.  I'm glad to hear you're happy with it.  I'm not 100% sure about the cause of some of these issues but I will give some notes below that might help...

Shoreline object... One of the changes from 5.1.3-->5.1.4 was the inclusion of the 'max depth range' setting on the shoreline object.  This setting allows better shoreline resolution steps by limiting the depth (in meters) of the shoreline capture, and should be as low as possible for your scene, though the default of 12 is usually sufficient.  However, this also affects the threshold in the Depth Range and Shore Range sttings, so these may need to be adjusted up or down accordingly after setting what your max depth range should be.

That being said, if you just get black regardless of the settings you use, than it could possibly be an issue with the terrain shader.  I would recommend doing a test where you put a large cube or other shape underneath the water using the default Unity Standard shader, just to see if the shoreline generation picks that up.  If it sees the box and not your terrain then you might try temporarily switching to the default Unity terrain shader instead of CTS.

One of the problems I've seen in the past with CTS was that, for some reason (and only in some particular circumstances) the depth generation was somehow failing... which had contributed to the shoreline not generating.  The solution in that case was to change or add a proper fallback to the end of the CTS shader that was used... Fallback "Diffuse".  This fallback does some magic stuff behind the scenes in Unity (unfortunately) and any time I've seen a weird issue with a Shader adding the fallback "Diffuse" line has very often fixed it.

As for some of the other issues you're seeing with cameras, I recommend setting Suimono to Automatic camera mode.  This mode will always track the camera set to 'MainCamera' tag.  Make sure that your main scene camera has the 'MainCamera' tag set, and that all other cameras are untagged.  Then when switching cameras between third and first person, you should write a method that a) turns off the MainCamera tag on the old camera, and b) turns on the MainCamera tag on the new camera in that order.  When Suimono is then set to 'Automatic' camera mode, it should then keep up with the camera changes (as long as you have the correct camera tagged with 'MainCamera').  Any other cameras in your scene (such as possibly a third camera for the inventory camera?) should be marked as untagged always... or at least they shouldn't have the maincamera tag or Suimono might get confused.

I'm not sure why you would have a box in your inventory view... it seems like changing the culling layers should fix that issue... like it should only render your inventory character layer.  Are you sure there aren't any other objects in that area or in your UI that might conflict somehow?

I'm not sure why the asset store Purchase Numbers are showing up blank, but it's not the first time I've seen this.  It seems to have started around the beginning of the summer when they switched their number formatting around.  I did bring it up to the Asset Store at the time, I can't believe it's not fixed yet :(  Did you receive an email with an Asset Store invoice when you purchased?  There might be other numbers listed their that I can use to confirm purchase.  Feel free to email me directly at konnichiwa@tanukidigital.com

Let me know if the above helps or if you still run into any trouble.

-Justin Kellis
Tanuki Digital



Hey Justin,

thank you for your reply, that was rather fast. I played around with the shoreline object and i have found out that i have missed to set the culling mask  ::) So this is working so far.
The only issues that i have not sorted out yet are the first person camera underwater effect and the inventory camera.
I have noticed that the underwater effect on the first person camera disappears when i look up in a certain angle. Also, i did not yet find out why the effect is always enabled as the third person camera is working fine.

I did no research in the inventory camera issue yet but i have followed your advise and untagged it. also i have checked the layers (so the terrain should not display at all) i have inspected the responsible UI code but i have not found anything more useful. The inventory camera should be set up correctly because it has worked before too. It just seems like the suimono maincamera / reflection camera is rendering its image into the inventory camera or Local layer. I am new to unity so i am not as that experienced but thats all i can say atm. I'll do some testing with the booth assets fresh imported together and report if i find anything useful.

Also i'll forward the payment stuff to your mail with some additional data. I'll put my forum name into the subject.

You need to make sure the setCamera is correct, use manual camera settings and if your camera is being created at realtime make sure to update the module script with your set camera.

If there is some sort of issue with your terrain shader and the suimono system you can completely separate suimono and the terrain by using a multiple camera system and rending the water to one camera and the terrain to another. This actually give you much more control over what you can do with his system without any glitches ;)



        moduleObject = GameObject.Find("SUIMONO_Module").gameObject.GetComponent<Suimono.Core.SuimonoModule>();
                moduleObject.setTrack = t.gameObject.transform;
                moduleObject.manualCamera = t.gameObject.transform;
                moduleObject.setCameraComponent = t.gameObject.GetComponent<Camera>();
                moduleObject.mainCamera = t.gameObject.transform;

     


This is how i have done it before. I did just set the manualCamera in auto mode and reset the track reference so it will set to manualCamera.gameobject. I did in fact forget to reset setCameraComponent so it never got updated. But after implementing the logic as Chingwa pointed out im sure it will update its internal members correctly and it will spare me from updating everytime the members or CheckCamera logic changes

I'm not sure why you would have a box in your inventory view... it seems like changing the culling layers should fix that issue... like it should only render your inventory character layer.  Are you sure there aren't any other objects in that area or in your UI that might conflict somehow?

He could render his UI to a separate camera as well.

To clear up (as i dont know what you mean): The inventory camera is a orthographic camera in front of the player, rendering the 3rd person model to a texture (That's why it is a box). This texture is then used in a Unity UI Image. I enable/disable this cam as i open/close the inventory. I have checked all culling mask settings, clip planes and settings available but i did not get it fixed.


Best regards.

onephpmastermind

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: Shoreline Object stays black
« Reply #6 on: September 26, 2017, 12:43:13 PM »
could be hard to debug without digging in to your project i think.

bumbummen

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Shoreline Object stays black
« Reply #7 on: September 26, 2017, 02:35:39 PM »
So i have set up a new test project and imported booth SurvivalMultiplayer and SUIMONO. The inventroy camera and underwater effect issues are gone now but i have noticed that the water surface is missing transparency and looks off. Also 3D Waves seem not to work. I tought it has to do with the CheckCamera method so i have commented out the camera selection code and implemented my own logic to set the mainCamera to the SceneCamera or the players CurrentCamera.
Also i am setting setTrack to null at the end of "if (setCamera != mainCamera)" to always track the current camera object (As far as i can see it would never update).
This did not fix the transparency issues at all but changing cameras is working fine now.
I will do some more testing tomorrow

Edit: I have got the abpve working, except of the shoreline/waves. after importing and setting up Advanced Foliage Shader v5 i have noticed weird shader issues to apperar and i think it's the source of my problems. These issues started after setting the AFS Deffered and Deffered Reflections shader https://docs.google.com/document/d/164MTEnV_-krBdMr-20QhPttY1bY5H46FtpSDM1UQdRk/edit#heading=h.ey0so4gxhab1

Best Regards
« Last Edit: September 26, 2017, 04:16:15 PM by bumbummen »

Chingwa

  • Administrator
  • Hero Member
  • *****
  • Posts: 1704
    • View Profile
    • Tanuki Digital
Re: Shoreline Object stays black
« Reply #8 on: September 26, 2017, 08:35:32 PM »
Interesting.  Do you have any ideas about why AFS would interfere?  I wonder what exactly those deferred shaders are doing?

bumbummen

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Shoreline Object stays black
« Reply #9 on: September 27, 2017, 01:19:56 AM »
Interesting.  Do you have any ideas about why AFS would interfere?  I wonder what exactly those deferred shaders are doing?

I am not really a shader guy yet but i have contaced Lars about the issue. I' will wait for Lars response and until that i am going to try out if i can fix it.
Also i will keep you guys updated.

bumbummen

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Shoreline Object stays black
« Reply #10 on: September 28, 2017, 01:39:48 PM »
So, i have set up some test projects over the week to find the incompatibility between these assets. First off, i have created a project with Standart Asset Environment, SUIMONO and AFSv5 (imported in this order). This project showed some serious shader gliches and after setting up 2 other projects with the same issues my unity crashed. I re-startd it and it all worked fine (sometimes its the simple things 23  ::) ).
So, with the knowledge that the assets are in fact compatible, i set up another project with SUIMONO. After some fiddeling and custom code to the camera selection, this part worked fine. I have also sorted out the inventory camera issue (that did not appear on the test project) by changing my Players layer to PlayerLocal and adjusting the mask of the inventory camera.

The biggest problem is Survival Multiplayer, which is shipped as a Project (including ProjectSettings). I think that there is some misconfigured setting in the asset that does not fit this constellation of shaders. It is possible to get these three working but it requieres some advanced knowledge with unity or fiddeling.

I will try to fix the underwater effect issue this weekend. i still have to take a closer look at the Underwaterfog and other involved classes. i'll post my solution if i will find one  :)

onephpmastermind

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: Shoreline Object stays black
« Reply #11 on: September 28, 2017, 03:18:11 PM »
So, i have set up some test projects over the week to find the incompatibility between these assets. First off, i have created a project with Standart Asset Environment, SUIMONO and AFSv5 (imported in this order). This project showed some serious shader gliches and after setting up 2 other projects with the same issues my unity crashed. I re-startd it and it all worked fine (sometimes its the simple things 23  ::) ).
So, with the knowledge that the assets are in fact compatible, i set up another project with SUIMONO. After some fiddeling and custom code to the camera selection, this part worked fine. I have also sorted out the inventory camera issue (that did not appear on the test project) by changing my Players layer to PlayerLocal and adjusting the mask of the inventory camera.

The biggest problem is Survival Multiplayer, which is shipped as a Project (including ProjectSettings). I think that there is some misconfigured setting in the asset that does not fit this constellation of shaders. It is possible to get these three working but it requieres some advanced knowledge with unity or fiddeling.

I will try to fix the underwater effect issue this weekend. i still have to take a closer look at the Underwaterfog and other involved classes. i'll post my solution if i will find one  :)

Suimono uses render textures to camera, if any of your other assets are doing this it may create a problem, you will have to wait until the dev gets back from vacation.

bumbummen

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Shoreline Object stays black
« Reply #12 on: September 28, 2017, 03:59:37 PM »
Suimono uses render textures to camera, if any of your other assets are doing this it may create a problem, you will have to wait until the dev gets back from vacation.

Are you about Camera rendering to a RenderTexture? MY Asset actually does that but i did not find any information on google that multiple different RenderTextures would cause any problems. Could you explain further?
I know and he knows the current state already  :)

onephpmastermind

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: Shoreline Object stays black
« Reply #13 on: September 28, 2017, 04:19:10 PM »
Suimono uses render textures to camera, if any of your other assets are doing this it may create a problem, you will have to wait until the dev gets back from vacation.

Are you about Camera rendering to a RenderTexture? MY Asset actually does that but i did not find any information on google that multiple different RenderTextures would cause any problems. Could you explain further?
I know and he knows the current state already  :)

I am not an expert on that myself. Apparently render textures do overlap/layer in shaders with combine texture command. It can be rather complicated when your using premade assets and not doing it from the ground up. In my project the only thing I am using premade is Smart FPS controller, his water system and a volumetric fog system everything else will be made from scratch.

onephpmastermind

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: Shoreline Object stays black
« Reply #14 on: September 28, 2017, 04:25:51 PM »
Suimono uses render textures to camera, if any of your other assets are doing this it may create a problem, you will have to wait until the dev gets back from vacation.

Are you about Camera rendering to a RenderTexture? MY Asset actually does that but i did not find any information on google that multiple different RenderTextures would cause any problems. Could you explain further?
I know and he knows the current state already  :)

Did you know my sandbox could be used for your game as well :) I am designing to work with all my future games.

https://www.youtube.com/watch?v=B_KlgMX59pc&feature=youtu.be

check out the latest... a work in progress. I am dedicating significant time to environment, eventually will have a night/day and a custom built dynamic weather system which will interface with clouds,ocean,mist,lighting and post process stack.