bero1985 / pasgltf Goto Github PK
View Code? Open in Web Editor NEWAn Object-Pascal-native GLTF 2.0 low-level-data loader and writer for GLTF and GLB files
License: zlib License
An Object-Pascal-native GLTF 2.0 low-level-data loader and writer for GLTF and GLB files
License: zlib License
Hello.
I have Lazarus 2.2.2 and FPC 3.2.2
I try to build but stoped - no PasDblStrUtils in '....\externals\pasdblstrutils\src\PasDblStrUtils.pas',
I git clone it and place to ....\externals\pasdblstrutils
Recomple
And I have an error
How to fix it?
One more question. Is pasgltf out with OpenGL or Vulkan?
Can output be with Vulkan? RTX also?
This unit does not compile under freepascal 3.0.4:
UnitOpenGLImagePNG.pas(259,9) Error: ENDIF without IF(N)DEF
Working around that, compilation later fails at UnitOpenGLImageJPEG:
UnitOpenGLImageJPEG.pas(237,16) Error: Identifier not found "TFPReaderJPEG"
There are glTF 2.0 extensions to define lights inside glTF file. It would be very useful for me (and Castle Game Engine :) ) if PasGLTF supported reading such lights.
Punctual lights (point, spot, directional) are defined in
https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual .
Blender can export such lights. I made example in CGE demo-models, https://github.com/castle-engine/demo-models/tree/master/gltf/punctual_lights . The test_lights.gltf inside defines 3 lights (point, spot, directional).
Image-based lighting is defined in
https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_lights_image_based .
Example of it is in
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/EnvironmentTest .
Loading a model from https://poly.google.com/view/9Vq_-HEtIHA (downloaded version using "Updated GLTF file") raises an error
Invalid GLTF document, missing "zfar" field
Indeed, glTF file doesn't specify zfar:
"cameras" : [
{
"perspective" : {
"yfov" : 0.7853981633974483,
"znear" : 0.1000000014901161
},
"type" : "perspective"
}
],
Looking at glTF 2.0 specification, zfar is not required for perspective cameras: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-perspective . It says "Required: No" and "If zfar is undefined, runtime must use infinite projection matrix." . But PasGLTF requires it, by reading it through Required
function,
result.fPerspective.fZFar:=TPasJSON.GetNumber(Required(....
on https://github.com/BeRo1985/pasgltf/blob/master/src/PasGLTF.pas#L4050 .
Also aspectRatio
is not required, according to the glTF 2.0 specification, but PasGLTF code makes it required.
Note that zfar
is still required for orthographic cameras, which may explain why this bug appeared :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.