Author Topic: Suimono 1.48 and Billboard issues...  (Read 2490 times)

malteins

  • Newbie
  • *
  • Posts: 19
    • View Profile
Suimono 1.48 and Billboard issues...
« on: October 09, 2014, 09:15:05 PM »
Hi, I'm currently working on a project and recently realized that there is a rendering issue when billboards are in the water. The billboards are rendering on top of the water even though the actual object is half inserted in the water. I'm leaving an image here so one can understand what I'm talking about.

Any help appreciated, thanks!  :)


Chingwa

  • Administrator
  • Hero Member
  • *****
  • Posts: 1604
    • View Profile
    • Tanuki Digital
Re: Suimono 1.48 and Billboard issues...
« Reply #1 on: October 09, 2014, 09:50:37 PM »
Hi Malteins,

Yes this is almost certainly caused because of a shader rendering queue issue between the suimono water shader, and the unity terrain's hidden tree billboard shader.

In general I've set the suimono shaders to render behind the trees because in many cases when viewed at a distance the water was covering up the tree billboards and looked unnatural.  However in your case you can reset the render position manually by editing the surface shader.

The default render queue for the tree shader is: Tags {"Queue"= "Transparent-100"}

In order to render the water in front of the trees the water render queue needs to be in front of the above tree queue...
for example: Tags {"Queue"= "Transparent-99"}

You should go through the suimono shader and switch all the render queues in each pass to be "-99" or larger.  Or, if you send me an email to konnichiwa@tanukidigital.com and tell me exactly which shader you're using in your scene ("Suimono_water_full" for example... or "Suimono_water_basic" etc.) I can make an edited version that should work for you.

-Justin

malteins

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Suimono 1.48 and Billboard issues...
« Reply #2 on: October 09, 2014, 11:33:58 PM »
Hi, thanks for your reply. Ok great I see there's a solution then :) . I'm using the Suimono Water Basic shader. Now the thing is that the area shown in the picture is only a portion of the whole terrain, there is a second source of water somewhere else in the level.

Should I duplicate the shader in order to apply one to the 2nd water source ( water in the picture ) and the other to the 1st water source, in order to apply your fix only tom my 2nd water source?

I'm not so sure about how to fix this properly, not good at coding at all :( , it'd be great if you could give me an example code.

Thanks again for your help!

PD: I'm leaving another image, where the same problem occurs but underwater. The billboard parts of the tree are rendered on top.

« Last Edit: October 09, 2014, 11:48:14 PM by malteins »

Chingwa

  • Administrator
  • Hero Member
  • *****
  • Posts: 1604
    • View Profile
    • Tanuki Digital
Re: Suimono 1.48 and Billboard issues...
« Reply #3 on: October 10, 2014, 08:35:19 AM »
Hi Malteins, I sent you an updated file via email.

There is a problem to this solution which you touched on above, and you need to make this decision on a per-project basis... replacing the shader will replace it in all instances. :( 

It's common that distant billboard trees either are obscured by the water or the water is obscured by the trees.  If you change the default shader with the one I sent you it really just reverses the problem... which will work fine for you when up close, but may give you problems when viewed from far away.

The best solution is probably to keep the shader as-is, but to increase your billboard distance on the terrain, so the nearby trees are still fully rendered and composited correctly with the water (i.e. not billboarded).  But again, this is a trade-off that needs to be determined on a per-project basis I think.