dustyroom-studio / quibli-doc

Documentation of the Quibli asset.
https://quibli.dustyroom.com
2 stars 1 forks source link

Curved World support #21

Closed KevinRoussel closed 1 year ago

KevinRoussel commented 1 year ago

Is your feature request related to a problem? Please describe. Hello world

I am trying to merge the CurvedWorld shader with Quibli. On FlatKit I managed to put CurvedWorld in place by changing some code but on Quibli I don't have a satisfactory result, at best the mesh curves well but the visual rendering is bad

Describe the solution you'd like I would like to have like on the flatkit with the majority of the code that is available and that can be uncommented

Additional context https://user-images.githubusercontent.com/9155865/201644672-e042ade8-bb8c-40ff-8f66-fea01a3059bb.mp4

dustyroom-studio commented 1 year ago

Hi, thank you for the video. To be able to understand this issue better and probably replicate it, I'll need to ask you for more details.

Thank you

KevinRoussel commented 1 year ago

Hello,

Thanks for the quick answer :)

DebugInfo:

Quibli version 1.5.0 Unity 2021.3.12f1 Dev platform: WindowsEditor Target platform: StandaloneWindows64 URP installed: True, version 12.1.7 Render pipeline: UniversalPipeline Color space: Linear Quality config: Quibli URP Config Graphics config: Quibli URP Config

Quibli is installed as described in the guide yes with the updated renderer in URP.

There is no error in the console, the shader code compiles, but the rendering doesn't seem to be correct, I prepare an empty project with only Quibli and CurvedWorld to isolate the problem.

I am not very experienced with the shader code, but for me there must be a problem with the normal that generates the shadow, I would like that there is no shadow nor height gradient is not influenced by the curvature of the world.

In the Flatkit there is some code to support curvedWorld (screen), using this code and moving some lines it does the job exactly as I expect, I have fixed a problem with Flatkit & CurvedWorld, if you want I can provide you my version of the code. Ideally I would like to have the equivalent of the flatkit code for quibli, the integration is very well done in the flatkit and it was very easy to add. image image

dustyroom-studio commented 1 year ago

Hi Kevin, Please make sure you are integrating Curved World into all passes in Stylized Lit, including forward, shadow caster, etc.

KevinRoussel commented 1 year ago

That's what I did I took the Flatkit code and applied the same logic. The piece of code from LitForwardPass_DR.hlsl (flatkit) I put in the QuibliVertex.hlsl

I have an empty project with FlatKit, Quibli and CurvedWorld and I reproduce my shadow problem. I can provide you the project (Unity 2021.3.12f1 and all up to date)

dustyroom-studio commented 1 year ago

I mean Curved World should be in all passes of StylizedLit.shader. Do you have it in the shadow caster pass?

KevinRoussel commented 1 year ago

Yes I have this, I can have made a mistake for the moment I have this code (screen) image

Update, in Flatkit when activating Unity's shadow I have the same behaviour. (screen, up Quibli, down Flatkit) How can I avoid having "curved shadows"? I would like to have the shading not curved because it generates visual glitches image

dustyroom-studio commented 1 year ago

Great, now I think you also need to copy ShadowPassVertex and ShadowPassFragment and customize them to support Curved World. We do not customize them in Quibli to support more Unity versions, that's why we can't have full Curved World integration out of the box.

KevinRoussel commented 1 year ago

Aaaaah yes I understand it works thank you! I would not have succeeded without your help.

https://user-images.githubusercontent.com/9155865/201727807-0ca263fe-ea89-4d46-9301-50fb436b5fc0.mp4