Replies: 1 comment
-
STL files are loaded via vsgXchange::assimp, this by uses either the PBR ShaderSet or Phong ShaderSet, both of which fully support lighting and shadows, just like the vsg::Builder generated meshes do. However, lighting depends upon the dataset having normals, and it could be that assimp isn't creating normals - if there are no normals on the original model then this would be correct. assimp does have support for generating normals. You can enable options like generating normals using vsg::Options class, and there is support for parsing command line args to map to these vsg::Options. You can list the supported options using vsgconv --features vsgXchange::assimp: $ vsgconv --features vsgXchange::assimp
vsgXchange::assimp provides support for 70 extensions, and 0 protocols.
Extensions Supported ReaderWriter methods
---------- ------------------------------
.3d read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.3ds read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.3mf read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ac read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ac3d read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.acc read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.amf read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ase read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ask read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.assbin read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.b3d read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.blend read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.bsp read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.bvh read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.cob read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.csm read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.dae read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.dxf read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.enff read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.fbx read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.glb read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.gltf read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.hmp read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ifc read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ifczip read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.iqm read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.irr read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.irrmesh read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.lwo read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.lws read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.lxo read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.md2 read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.md3 read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.md5anim read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.md5camera read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.md5mesh read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.mdc read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.mdl read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.mesh read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.mesh.xml read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.mot read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ms3d read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ndo read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.nff read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.obj read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.off read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ogex read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.pk3 read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ply read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.pmx read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.prj read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.q3o read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.q3s read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.raw read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.scn read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.sib read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.smd read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.step read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.stl read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.stp read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.ter read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.uc read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.vta read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.x read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.x3d read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.x3db read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.xgl read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.xml read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.zae read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.zgl read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
vsg::Options::Value type
------------------- ----
crease_angle float
culling bool
discard_empty_nodes bool
external_texture_format vsgXchange::TextureFormat
external_textures bool
generate_sharp_normals bool
generate_smooth_normals bool
print_assimp int
sRGBTextures bool
two_sided bool |
Beta Was this translation helpful? Give feedback.
-
While learning vulkanscenegraph, I'm writing my own viewer program based on vsgviewer. I'd like to change the material appearance of an STL mesh loaded into the viewer through vsgXchange. Since an STL file is just pure geometry, I assume that
vsgXchange
fills in various default properties/nodes on its own. I had a look at the resulting vsgt as output by vsgconv, and tried to find a light/illumination node, but I could not find it. So what makes it visible?In contrast, if I create through a
vsg::Builder
, I have figured out that I must add a light on my own to the scene, e.g. byvsg::createHeadlight()
. Is there any way of making a model loaded by vsgXchange, behave the same, so that I have to add illumination on my own?Beta Was this translation helpful? Give feedback.
All reactions