-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong "data type" field in sub-geometries streams datas #3
base: master
Are you sure you want to change the base?
Conversation
Hi Thanks for reminidng me about this issue. |
Hi,
It's exactly what i try to achieve :). Since opengl buffer cannot hold mixed types (GL_FLOAT and GL_SHORT), i need to split interleaved buffers by type. Here i use the
Yep, but the parsing rely on the fact that parser exactly know the predefined type of each stream:
to guess the read methods, number of vertices etc... I try to have weak dependency to those predefined types, because in generally need custom attributes (eg : vertex colors). So for now i'm just rely on Anyway, for now i fix the issue by replacing unexpected str_ftype by correct ones since "nobody need signed short or unsigned byte buffers". One more word about "send the whole junk of bytes directly to the gpu " I'm using AWD format in webgl. And to really upload awd file in GPU without copy, streams need to be aligned. https://www.khronos.org/registry/typedarray/specs/latest/#7
for my "InterleavedGeometry" i add a padding field before every streams, to ensure the stream start on a multiple of the type size. |
Hey I see that the valid setting of str_ftype is needed, when working with custom streams.
The thing is: none of our plugins had support for custom-streams, so the value really never was used. If someone was to do implement custom-streams (as you are doing now), he would have to use the str_ftype inside the parsing function that is exclusive for the custom-stream type anyway. For all existing stream types, str_ftype really has no meaning. I know this is a little inconsistent, so as mentioned before, i will change this in never versions. I think the way you describe how you use the str_ftype is the same i would do when implementing custom streams. I still not sure if i understand what your are doing in the end. Are you modifing older AWD files offline, or are you modifing the c4d plugin to export custom stream ? Thank you for the tip on the byte-offset. this might be really helpful / useful. |
Hi, Until now, i used to modify exporters and parser to fit my project's needs. Add custom vertex attributes, specific geometry types and other fancy stuffs. Customizing exporter is pretty tought and we don't use the same 3D editor for each project (3DS, C4D...). Now i try to make a tool which take an fully compliant AWD file and output a modified one. (Interleaved geometries, swap Y/Z, merge geoms etc). So i can reuse / add those features across projects. Customs vertex attributes can only be added by exporters, so i still need to customize them. But the tool should be able to parse, transform geometries containing those custom streams. That's why i try to not depends on predefined streams types. |
hey Sounds very interesting. What environment will you use to develop your tool ? If you have any open source plans, i would be happy to assist you as good as i can. Right now, i am the only active dev for all the awaytools, and its a lot that has to be done, and so little time. I am working heavily on the FlashPro-exporter. I recently started to look into the FBX SDK, and started to work on a little cpp-application that will allow to convert FBX files into AWD. Doing this mainly because having a FBX to awd solution, will take away the pressure on tool-development for many 3d-packages (e.g. autodesk stuff). In general i am happy about all help i can get, to make AWD workflows as painless as possible. Anyway. if you interested in cooperation on this, just ping me on skype ("achtzig prozent"). |
Hi, The tool is here: I started it last week for an on-going webgl project, so it's a bit rought and messy right now and i can only focus on features i need. It only parse "core features", geometries, meshes, containers... FBX to AWD is definitely the ultimate solution, since almost all 3D editors can export fbx. I will help in it's development if you plan to use the C++ sdk. I didn't wrote python for years! Pierre |
Hey Cheers Robin |
Hi,
In C4D exporter data type field seems to be set to the size (in bytes) of the underlying data type, 2 for U16 and 4 for F32, and don't take precision into account ( float or double)
Ok, specifications are not perfectly clear about this field.
But according to awd-sdk and AwayBuilder encoder implementation, this field should match one of the AWD_field_type, depending on stream precision:
Integer : 5 (AWD_FIELD_UINT16)
Floats low : 7 (AWD_FIELD_FLOAT32)
Floats hi : 8 (AWD_FIELD_FLOAT64)
The types enum :
https://github.com/awaytools/awd-sdk/blob/master/cpp-libawd/include/awd_types.h#L39
AWD-SDK stream impl:
https://github.com/awaytools/awd-sdk/blob/master/cpp-libawd/src/stream.cc#L49
AwayBuilder AS3 impl
https://github.com/awaytools/AwayBuilder/blob/master/awaybuilder-core/src/awaybuilder/utils/encoders/AWDEncoder.as#L1931