Home › Forums › Graphics / Blender › gtaoVisible
- This topic has 12 replies, 3 voices, and was last updated 5 months, 1 week ago by David Duperron.
-
AuthorPosts
-
2024-06-19 at 3:15 pm #75050David DuperronCustomer
Hi!
I’ve been running into some strange issues with some of my materials, which have unexpected and unpredictible behaviours.
After a lot of testing I think it might be linked to the use of Ambient Occlusion, and the material option “gtaoVisible”.
Where is this parameter controlled in the Blender materials definition??
Has anyone experienced issues using the real time Ambient Occlusion??
Thanks for the help!David
2024-06-20 at 6:08 am #75078Alexander KovelenovStaff2024-06-20 at 7:50 am #75082David DuperronCustomerHi Alexander!
Thanks for the info.
I am completely lost right now… I’ve got a material which sometimes shows up properly, and sometimes does nos show at all. I do nothing in between these cases except refreshing my web page, with exactly the same steps…
Here is a capture of the material:
I use this material for a grab/rotate gizmo which is supposed to show when I select an object. the color is driven by the vertex color of the mesh, and I use the Object Index to drive the intensity of the emission (when the object is dragged, it is highlighted). Everything was working fine until now, and I cannot identify what can cause such an unpredictable behaviour.
Same gltf file, same binary file, same js files, and after initial loading, sometimes the material shows, sometimes it is not! No error message in the console. No clue… I’m lost.2024-06-20 at 8:48 am #75083David DuperronCustomerI think I may have found something, which is perhaps a bug. It seems that it has something to do with the “HiDPI compositing” option for the objects that has this material.
When this option is active, an object with this material which shows up properly at the initial loading of the 3D scene can disappear after a few orbiting and change of point of view! Absolutely no other interaction with the object itself, and no puzzle related to it.
Disabling the HiDPI option seems to solve the issue…2024-06-20 at 8:56 am #75084David DuperronCustomerYes. That’s it!
If I try to activate the HiDPI option on some of my gizmo objects (e.g. xy plane move and Z-rotate), these two objects have the issue = not showing, whereas all the other objects with the same material and no HiDPI option are showing properly.
And the issue is not systematic as I mentionned earlier. It can show properly from time to time, without any reason.2024-06-20 at 10:10 am #75085David DuperronCustomerAlso Alexander: is there a way to control or change this parameter, either in Blender before the gltf export, or programmatically with some javascript? I don’t see any reference to this parameter in the developper reference…
2024-06-20 at 11:28 am #75089Alexander KovelenovStaffI see, could you please provide a minimal scene which reproduces this behavior so we can check ourselves?
Also Alexander: is there a way to control or change this parameter, either in Blender before the gltf export, or programmatically with some javascript? I don’t see any reference to this parameter in the developper reference…
The option is assigned on all materials which have “Alpha Blend” mode. This is done during glTF export.
2024-06-20 at 11:42 am #75090David DuperronCustomerThanks Alex!
I’ll try to pack something that reproduces this behaviour…
And lastly, is it possible to change this gtaoVisible parameter after the scene loading? (from false to true) and to update the material in order to display with Ambient Occlusion?
Thanks!David
2024-06-20 at 1:07 pm #75091Alexander KovelenovStaff2024-06-20 at 2:07 pm #75092David DuperronCustomerThe easiest way would be to publish the App on the Verge3D network, but I have a 500:Internal server Error when I try to publish it. The Application folder is located outside the “normal” verge3D application folder and i use a symbolic link… any way to get it to upload properly??
2024-06-20 at 2:10 pm #75093David DuperronCustomerI’ve tried to enable it manually with js code. I managed to retrieve the correct material, and write the gtaoVisible parameter to “true” but I see no effect on the viewport… I used the following code:
const material = v3d.SceneUtils.getMaterialByName(app, "NI_paint_vertex_color") material.needsUpdate = true; material.gtaoVisible = true; console.log(material)
I can see in the console that the parameter has been set to true, but no visual change…
2024-06-20 at 2:36 pm #75095kdvParticipantI can see in the console that the parameter has been set to true, but no visual change
Emission shader is ignored by the GTAO generator. PBR materials are also ignored (they have no nodes).
canUseGTAO() { const canUse = // GTAO only (diffuse occlusion) this.hasNode('BSDF_DIFFUSE_BL') || this.hasNode('SUBSURFACE_SCATTERING_BL') || this.hasNode('PHYSICAL_MX') || this.hasNode('STANDARD_SURFACE_AR') // GTSO only (specular occlusion) || this.hasNode('BSDF_GLASS_BL') || this.hasNode('BSDF_GLOSSY_BL') // GTAO + GTSO || this.hasNode('BSDF_PRINCIPLED_BL') || this.hasNode('EEVEE_SPECULAR_BL'); return canUse && this.gtaoVisible; }
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-06-21 at 7:38 am #75109David DuperronCustomerThanks @kdv!
The material on which I would like to activate gtao is not an emission shader.
GTAO can actually be activated on it as I can do it manually by changing thegtaoVisible
parameter in the .gltf file before loading the application.
In fact this parameter is false by default because the material has a transparency (alpha blend) which can be controlled by the user. Most of the time the material is opaque, and then it looks much better with GTAO, and in some rare cases the transparency is used, and in those cases, the problems related to GTAO in use with transparency are not really an issue for me… so I would like to be able to change this gtaoVisible parameter for this material after loading of the gltf file, and be avle to see the result in the viewport. -
AuthorPosts
- You must be logged in to reply to this topic.