Page 1 of 1

Request: Better Flakes

Posted: Thu Sep 10, 2020 11:58 am
by leehenshall
We currently have OSL Flakes via the script created by Chaos Group:

https://docs.chaosgroup.com/display/OSL ... normal+map

This works well for most cases and achieves a good result if used correctly. I am finding it has a big limitation though. It does require perfect or near perfect UVs to work properly.

In the early days of OSL for Octane a user added the ability to use triplanar projections so it wouldn't rely on UVS but instead added a projection pin to the OSL node allowing for Octane Triplanar/box etc.

For some reason though even though the triplanar projection works just fine, it is still possible to get seams that are caused by the UVS. Maybe it has something to do with how normal maps work or something along those lines. The only work around I have is to take all my car body panels into Rizom UV and create clean seamless UVs. Then the OSL flakes look great.

Maybe someone at Otoy could take a look at the OSL script help find a more fool proof way of procedurally applying the texture. I think though in the long term Octane should have have an advanced procedural flake shader built into the core that does not require any UVs to work properly. This combined with the new layered materials would be perfect.

Re: Request: Better Flakes

Posted: Fri Sep 11, 2020 6:16 am
by bepeg4d
Hi,
do you mind to share a a example scene that shows the issue?
Which SDK version are you using exactly?

I have checked OSL Flakes with Triplanar projection few weeks ago for an user, and everything seemed to work as expected :roll:

ciao Beppe

Re: Request: Better Flakes

Posted: Fri Sep 11, 2020 9:41 am
by leehenshall
Thanks for the response.

While trying to create a test setup to show you the issue. I think I may have figured out what is happening.

Here is the triplanar setup in the node editor:
Flake Triplanar Setup.jpg
If I render this, I get harsh fall off where there are UV seams:
UV_TAG_ON.jpg
This only really becomes obvious when the "Flake Normal Orientation" is dialled to higher values. I do find it necessary to dial this value to around 0.7 - 0.95 to get the look I need.

By accident though I think I fixed it by deleting my UV tag from the polygon object.

See the results below:
UV_TAG_OFF.jpg
For some reason the object needs to have no UVs for the triplanar to work properly. I'll do some more tests on my actually production car and see if the fix is really this simple.

Re: Request: Better Flakes

Posted: Fri Sep 11, 2020 9:55 am
by bepeg4d
Hi,
thanks for sharing some screenshots.

Please, have a look at C4D Vray manual about Flakes node, and in particular about Flakes Orientation
Flakes Orientation
  • controls the orientation of the flakes relative to the surface normal. When this is 0.0, all flakes are perfectly aligned with the surface. When it is 1.0, the flakes are rotated completely randomly with respect to the normal. Values above 0.5 are not recommended as they can produce artifacts.
ciao Beppe

Re: Request: Better Flakes

Posted: Fri Sep 11, 2020 10:32 am
by leehenshall
When the triplanar is working by deleting the UV tag or the UVs are perfect values above 0.9 work fine.

Any values below 0.5 do not look particularly good. Values above this are essential:
Flake_Orientation_0.5_Bad_Result.jpg
Pardon the pun but I think this is a "Flakey" :roll: workflow if the values I need to get the look I want could cause artefacts.

I think the OSL flakes script is good but I think there is a reason Chaos Group never really used it as a workflow. I remember using this osl script back in the day when it appeared in the V-Ray manual, Vlado said it was difficult to anti-alias at the time which is why the Stochastic Flakes white paper technology was integrated into V-Ray 3. Octane seems to handle it like a champ though. V-Ray 5 now also has a fully re-written carpaint shader similar to the one in Arnold.

I think I can work around my issue by deleting the UV tags which looks like it is fixing the bug with the seams. However I think my point still stands - Octane would benefit from having dedicated core level shaders for this kind of thing rather than relying on old OSL code by Chaos Group.

Re: Request: Better Flakes

Posted: Sun Sep 13, 2020 11:36 pm
by itsallgoode9
on the topic of improving flakes, I've always found this extremely odd to have the flakes be circles. If you're doing extreme closeup the circle shapes can clearly be seen, which looks very odd. Maybe my assumption is wrong but I imagine in real car paint, flakes are much more geometric/organic in shape? Unfortunately I have very limited knowledge of coding, and I have no clue how i'd go about adjusting the OSL to create something like this. I think even having squares instead of circles would look better (and I imagine easier to code than completely random geometric shapes), even if it's not the technically correct shape of real world flakes.

Indeed I agree with eh OP that it would be very helpful if OTOY coded their proprietary flake texture rather than relying on this very old (and IMO incorrect) ChaosGroup shader.

Re: Request: Better Flakes

Posted: Mon Sep 14, 2020 7:00 pm
by Goldorak
itsallgoode9 wrote:on the topic of improving flakes, I've always found this extremely odd to have the flakes be circles. If you're doing extreme closeup the circle shapes can clearly be seen, which looks very odd. Maybe my assumption is wrong but I imagine in real car paint, flakes are much more geometric/organic in shape? Unfortunately I have very limited knowledge of coding, and I have no clue how i'd go about adjusting the OSL to create something like this. I think even having squares instead of circles would look better (and I imagine easier to code than completely random geometric shapes), even if it's not the technically correct shape of real world flakes.

Indeed I agree with eh OP that it would be very helpful if OTOY coded their proprietary flake texture rather than relying on this very old (and IMO incorrect) ChaosGroup shader.
Make sure to add a vote on the feature request list, so we can prioritize this with the rest of the roadmap work. Thanks!

Re: Request: Better Flakes

Posted: Thu Sep 24, 2020 12:34 pm
by leehenshall
I have created a feature request for Car Paint specific shaders here:

https://render.otoy.com/requests/

If anyone thinks this would be useful please vote it up :)