Replies: 3 comments
-
The assimp reader is not looking for any other parameters when reading --two-sided. not the void in the code vsgXchange/src/assimp/assimp.cpp:
In this case it's treating the presence of --two-sided as true. The default will be off, so forcing it one will be the normal thing that users will likely want. If we need more command line control over it we'll need to add another option check. The code for deciding whether two sided is used is when setting up the shader composition is:
Which looks like if either two_sided is passed in via the Options (which in turn can be set from the command line) or from the material settings provided by the assimp library when reading the file. I presume in your case the actual model is specifying two sided lighting which is why it's not off by default. To override this I think it should be possible to do:
Being able to do this from the command line would be nice, but like the convenience of passing a single --option_name over --option_name value for things that are normally off and adding the --option will enable it. Perhaps having the value be optional i.e. checked for --option_name true, --option_name false first then --option_name with implicit true. I'm open to suggestions. |
Beta Was this translation helpful? Give feedback.
-
Ah that makes sense. If it's possible, being able to It does turn out the default for backface culling in Blender is off - So once exported to gltf, if you forgot to turn on backface culling for each material it'll translate to two_sided in the vsg conversion, and look somewhat different than the original Blender scene. I assume that's blender doing shadows/fancier shaders, so even without culling the light can't pass through an object. |
Beta Was this translation helpful? Give feedback.
-
I have added specialization of the vsg::CommandLine::read(..) methods for the bool case that enable the following usage:
I have also changed vsgXhcnage::assimp to use bool rather than void for command line parsing of bool paramters as this wasn't possible before as I wanted the --toggle (without parameter usage to be the default usage) for enabling a feature. These changes are merged with VulkanSceneGraph and vsgXchange master and respective 1.0 branches. |
Beta Was this translation helpful? Give feedback.
-
Hopefully an easy question, or I'm missing something obvious, but I don't seem to be able to turn boolean options like two_sided off when using vsgconv (I'm trying to debug why I'm getting lighting from behind an object, whether it's this or my vr integration stuff messing with the lighting again).
Running
vsgconv foo.glb foo.vsgt --crease_angle 10
or similar for numeric arguments seems to work fineRunning
vsgconv foo.glb foo.vsgt --two_sided 0
doesn't - Gets confused over what's an option vs a pathLooking in utils/CommandLine.h we see this - I can't see what command line argument I should provide to turn the boolean flag off. In this case two_sided is I think on by default because of how my materials were exported to gltf from blender. I'd prefer to just toggle it back off on the command line for now.
Beta Was this translation helpful? Give feedback.
All reactions