Replies: 3 comments
-
For the per vertex data the vector sizes must be identical. combining
different sizes makes no sense. The indices in DrawElementsUShort should
range from 0 to this vector size.
Regards, Laurens.
…On Thu, Feb 13, 2025 at 4:01 PM scanline ***@***.***> wrote:
I'm working on an exporter for the .osgt format and have a little trouble
getting things to look correct - probably because I'm not completely sure
about the file format's structure/syntax.
If the model just consists of vertex (VertexArray) and uv
(TexCoordArrayList) data everything's okay but as soon as there's normal
(NormalArray) and tangent (TangentArray) data, osgviewer seems to ignore it
or simply skips the uv section.
What could possibly be wrong with a file like this:
#Ascii Scene
#Version 161
#Generator OpenSceneGraph 3.5.6
osg::Group {
UniqueID 1
Children 1 {
osg::Group {
UniqueID 2
Name "Root"
Children 1 {
osg::MatrixTransform {
UniqueID 3
Name "Cube"
Children 1 {
osg::Geode {
UniqueID 4
Name "GeodeCube"
Drawables 1 {
osg::Geometry {
UniqueID 5
Name "Test"
StateSet TRUE {
osg::StateSet {
UniqueID 6
Name "Test"
AttributeList 1 {
osg::Material {
UniqueID 7
Name "Test"
Shininess TRUE Front 10 Back 10
Ambient TRUE Front 0 0 0 1 Back 0 0 0 1
Diffuse TRUE Front 0.64 0.64 0.64 1 Back 0.64 0.64 0.64 1
Emission TRUE Front 0 0 0 1 Back 0 0 0 1
Specular TRUE Front 0.5 0.5 0.5 1 Back 0.5 0.5 0.5 1
}
Value OFF
}
TextureModeList 1 {
Data 1 {
GL_TEXTURE_2D ON
}
}
TextureAttributeList 1 {
Data 1 {
osg::Texture2D {
UniqueID 8
WRAP_S REPEAT
WRAP_T REPEAT
MIN_FILTER LINEAR_MIPMAP_LINEAR
MAG_FILTER LINEAR
Image TRUE {
ClassName osg::Image
UniqueID 9
FileName "texture.png"
WriteHint 0 2
DataVariance STATIC
}
}
Value OFF
}
}
}
}
PrimitiveSetList 1 {
osg::DrawElementsUShort {
UniqueID 11
Mode TRIANGLES
vector 36 {
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
}
}
}
VertexArray TRUE {
osg::Vec3Array {
UniqueID 12
Binding BIND_PER_VERTEX
vector 12 {
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
}
}
}
TangentArray TRUE {
osg::Vec4Array {
UniqueID 13
Binding BIND_PER_VERTEX
vector 48 {
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
}
}
}
NormalArray TRUE {
osg::Vec3Array {
UniqueID 14
Binding BIND_PER_VERTEX
vector 36 {
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
}
}
}
TexCoordArrayList 1 {
osg::Vec2Array {
UniqueID 15
Binding BIND_PER_VERTEX
vector 12 {
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
}
}
}
}
}
}
}
Matrix {
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
}
}
}
}
}
}
—
Reply to this email directly, view it on GitHub
<#1358>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEXFTWX4Z7VDQ6MUVEQXYB32PSXTNAVCNFSM6AAAAABXCMX6MGVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXHE3DCNBYHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks Laurens! Do you happen to have a sample .osgt file utilizing a NormalArray & TangentArray I could study? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Attached is an osgt file using osgFX::BumpMapping, which needs normals,
binormals and tangents as vec4 on vertex attributes 6,7 and 15.
The textures (whitemetal_normal.jpg and whitemetal_diffuse.jpg) are
part of openscengraph
data <https://github.com/openscenegraph/OpenSceneGraph-Data>.
Regards, Laurens.
…On Thu, Feb 13, 2025 at 8:08 PM scanline ***@***.***> wrote:
Thanks Laurens!
Do you happen to have a sample .osgt file utilizing a NormalArray &
TangentArray I could study?
—
Reply to this email directly, view it on GitHub
<#1358 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEXFTWQDNNUGIJ4DZYUMV6T2PTUT5AVCNFSM6AAAAABXCMX6MGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMJZGE4DENY>
.
You are receiving this because you commented.Message ID:
<openscenegraph/OpenSceneGraph/repo-discussions/1358/comments/12191827@
github.com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on an exporter for the .osgt format and have a little trouble getting things to look correct - probably because I'm not completely sure about the file format's structure/syntax.
If the model just consists of vertex (VertexArray) and uv (TexCoordArrayList) data everything's okay but as soon as there's normal (NormalArray) and tangent (TangentArray) data, osgviewer seems to ignore it or simply skips the uv section.
What could possibly be wrong with a file like this:
Beta Was this translation helpful? Give feedback.
All reactions