Ambient occlusion question

SCS Software ATS and ETS2 editing using ZModeler3 filter. Models, Materials, Animation.

Moderator: Oleg

Post Reply
Mmeister
Posts: 73
Joined: Mon Dec 20, 2021 9:42 am

Ambient occlusion question

Post by Mmeister »

Hello,

I would ask for advice on AO render. The most of surfaces is perfect but the Cylindrical surface of Airtank seems to have some issue. On the edges of the polygon forming the round cylinder there are shadow lines - that shouldn't be, making it look jaggedy in game.

So my question would be how to make AO of cylinder look smooth?

I thought to make another mat -> another higher resolution AO just for the cylinder -> but that is probably not the best way to go since its best to have as little number of dds files as possible (correct me here if i'm wrong)?


Image
User avatar
Oleg
Site Admin
Posts: 14543
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Ambient occlusion question

Post by Oleg »

hello.

try surface\normals\smooth tool on airtank object, then render this fragment again.
Mmeister
Posts: 73
Joined: Mon Dec 20, 2021 9:42 am

Re: Ambient occlusion question

Post by Mmeister »

Thank you very much Oleg, will try and report back
User avatar
Oleg
Site Admin
Posts: 14543
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Ambient occlusion question

Post by Oleg »

as a quick test, move this object out of the frame (3-5 meters away) and render it again. Just to find out whether this is self-affecting issue or some objects around give this effect. If this is a self-affecting case (still get bad shading on this object), send me a .z3d file with just this problematic object there, I will take a look what is the cause.
Mmeister
Posts: 73
Joined: Mon Dec 20, 2021 9:42 am

Re: Ambient occlusion question

Post by Mmeister »

Hi Oleg,

It seems like self affected issue. I've rendered it separately and its not much smoother.
User avatar
Oleg
Site Admin
Posts: 14543
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Ambient occlusion question

Post by Oleg »

send me a file with just this object in scene, I'll take a look.
Mmeister
Posts: 73
Joined: Mon Dec 20, 2021 9:42 am

Re: Ambient occlusion question

Post by Mmeister »

Sent you the file. Pls take a look. Also the curve on the frame appears the same way. The S bend right in-front of 1st axle.
User avatar
Oleg
Site Admin
Posts: 14543
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Ambient occlusion question

Post by Oleg »

Fixed. Get an update.

P.S. use Surface\Nornals\Calculate and Surface\Normals\Smooth before AO-rendering, as surface normals on original 3D model are used in AO computation. Bad normals can give artifacts.
Mmeister
Posts: 73
Joined: Mon Dec 20, 2021 9:42 am

Re: Ambient occlusion question

Post by Mmeister »

Thank you Oleg,

Works now perfectly.
Mmeister
Posts: 73
Joined: Mon Dec 20, 2021 9:42 am

Re: Ambient occlusion question

Post by Mmeister »

Hi Oleg,

One question.
Is there any chance to render AO with the GPU in ZModeler3 instead of CPU?

I tried that in Blender and it take a few seconds compared to CPU rendering. Blender native Cycles - Bake, or TEXtool.
User avatar
Oleg
Site Admin
Posts: 14543
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Ambient occlusion question

Post by Oleg »

nope, no plans on redoing this code
Mmeister
Posts: 73
Joined: Mon Dec 20, 2021 9:42 am

Re: Ambient occlusion question

Post by Mmeister »

Hi again.

If I may continue this topic.

I made chamfers on cylindrical body: polygon mode -> slicing tool (adding the splitting line) -> center the pivot -> scale in appropriate views and directions -> calculate normals (C) -> smooth vertices

And the cylinder still looks jagged both in Zmodeler3 and the game.

Please help how to make this appear smooth.
Thank you.

Image
User avatar
Oleg
Site Admin
Posts: 14543
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Ambient occlusion question

Post by Oleg »

something is not good with the topology of the mesh. I think it should have outline edges on capping and chamfer. so the surface\normals\calcualte gives an accurate shading and sharp edges. then you can smooth these sharp edges with surface\normals\smooth.

also, keep in mind that environment reflection texture on your material is not accurate and can give inaccurate visual perception of the surface/shape.
Mmeister
Posts: 73
Joined: Mon Dec 20, 2021 9:42 am

Re: Ambient occlusion question

Post by Mmeister »

I'm losing my marbles. I need some help. The ones marked dark blue are mode from cylinder object in Zmodeler and still when smooth normals applied its AO looks like this. With jagged lines. Light blue are the same problem but not made from Zmodeler origin. Orange and light blue parts are made with CAD and then to STL -> Blender -> OBJ -> Zmodeler and exact same issue. I tried smoothing of normals in Blender before export as well and still the same issue. Rendered AO 2k 128rays to 192rays in 4k, result is the same. I mean I tested every possible way I could think of, adjusting smoothing value parameters like angle from 5°and 45°, its probably 10 more things I could do I just lack time. Any suggestions what is going on, otherwise i'll call it a day, and publish such jaggedy AO, spent 2 days on this alone.

Image
Image
User avatar
Oleg
Site Admin
Posts: 14543
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Ambient occlusion question

Post by Oleg »

I quick-tested an unwrapped cylinder with AO render and see nothing specific. I advise to make a render with no other objects visible in scene, so nothing affects the rendered object at all (just to check self-shadows in AO render). There should be no artifacts in such a render; then you can render with more objects to see whether any issue appears. I guess the issue is caused by some object in your scene.
Screenshot 2024-10-12 184206.png
Mmeister
Posts: 73
Joined: Mon Dec 20, 2021 9:42 am

Re: Ambient occlusion question

Post by Mmeister »

Yes, it appears that some old object is causing the issue.
I have moved the geometry in question away from the rest and its a bit better, not perfect. Exact AO problem happens in blender as well.

Mind if I ask what specifically may be the cause? Just generally what to look for - I really would not wanna rework the entire thing from ground up. Perhaps deleting parts until I get the culprit. I suspect that perhaps some internal surfaces of these steel beams near the cylinders (and there are plenty because of how the old model was built) could be the cause. I wanna make sure problem is eliminated from the model before I make any new geometry.
User avatar
Oleg
Site Admin
Posts: 14543
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Ambient occlusion question

Post by Oleg »

artifacts are usually caused by inaccuracy of math inside 32-bit floating point values. An extremely high or low values in computation (very big or very small objects), or very tiny triangles in a mesh.
another reason could be an object scale not being reset to {1, 1, 1}. If you have a scaled object in scene, this could be an issue, but I'm not quite sure whether is actually affects computation or not.
Post Reply