Commit graph

395 commits

Author SHA1 Message Date
Jon
c74230a9ea
Enable DRM platform cross compilation support (#1717)
* Log a warning if chdir failed, use agnostic CHDIR instead of chdir

* Only include libdrm directory explicitly when not cross compiling
2021-04-09 19:57:14 +02:00
raysan5
7b37caa96c REVIEWED: Model scale #1700 2021-04-05 13:47:52 +02:00
raysan5
c21baf0d92 ADDED: GenMeshDefault() #1556 2021-04-02 15:56:35 +02:00
raysan5
aed0fee2ca Remove trailing spaces 2021-04-01 20:24:33 +02:00
raysan5
cdc3754449 ADDED: Support model normal matrix location #1691 2021-03-31 20:44:16 +02:00
raysan5
c772de702b REVIEWED: DrawMeshInstanced() matrix computations
Simplified some parts and reviewed for a correct computation of matrices, considering stereo render view/projection per eye transformations
2021-03-31 19:59:23 +02:00
raysan5
fd3e2fda00 RENAMED: example: shaders_mesh_instancing
shaders_rlgl_mesh_instanced -> shaders_mesh_instancing
2021-03-31 18:40:04 +02:00
raysan5
8f1d81df0f Review code formatting 2021-03-31 17:55:46 +02:00
raysan5
b5aaf33058 Review matrix multiplication 2021-03-28 22:04:04 +02:00
raysan5
aaf0d8b839 REVIEWED: rlgl: Stereo render is working again
As a bonus, stereo render is compatible with mesh instancing now!
2021-03-28 21:35:58 +02:00
Carlos Hernandez Barbera
7eaeffc8d9
GetCollisionRayMesh makes use of triangle count (#1688)
Co-authored-by: Carlos Hernandez Barbera <carloshdezbarbera@gmail.com>
2021-03-27 18:24:39 +01:00
Ray
f9bab14fdb REVIEWED: DrawMeshInstanced() 2021-03-26 00:12:29 +01:00
Ray
fb9a437f8a REVIEWED: OpenGL 1.1 working again 2021-03-25 20:35:48 +01:00
Ray
cba412cc31 WARNING: BREAKING: rlgl redesign -WIP-
rlgl module has been completely redesigned to move Mesh/Material structures to [models] module. Still some work to do, broken elements:
 - [models] OpenGL 1.1 mesh rendering: DrawMesh()
 - [models] Mesh Instancing: DrawMeshInstanced()
 - [models] Stereo rendering: DrawMesh()
 - [models] GL_FLOAT, GL_UNSIGNED_INT exposed
 - [models] GenMeshCustom()
 - [rlgl] GenTexture*() functions removal?
2021-03-25 14:28:12 +01:00
Ray
9bea64b5e4 REMOVED: DrawGizmo()
This is a very simple and specific implementation that should be better addressed by the users
2021-03-24 17:02:40 +01:00
Jeffery Myers
c6dd41495b
typecast warning fixes. (#1667)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-03-22 20:45:46 +01:00
Ray
24dae29a03 Review latest PR and some formatting 2021-03-22 20:41:33 +01:00
Ray
c37f61d31f REVIEWED: rlgl module #1523 2021-03-21 20:31:35 +01:00
Ray
ed4ca6a7f3 WARNING: BREAKING: rlgl module redesign -WIP-
- Some rlgl functions have been moved to core
 - Some functions have been made internal to rlgl
 - rlgl functions prefixed with rl*()
2021-03-21 01:29:31 +01:00
Ray
9909068714 Removed trailing spaces 2021-03-19 19:43:44 +01:00
Ray
664fbb87f5 REVIEWED: Material params #1649
Just assigned a fixed memory size for custom Material parameters in case of being required, so we shouldn't worry about allocating/freeing them.
2021-03-18 13:57:53 +01:00
Ray
8b0574a217 REVIEWED: DrawLine3D() #1643 2021-03-18 13:41:58 +01:00
Hristo Stamenov
bc9194690c
Implement UnloadModelAnimations (#1648) 2021-03-14 19:30:18 +01:00
Hristo Stamenov
f9b79403d1
Improve gltf support (#1647)
* Implement a load values from accessor function.
Added some more value types for the different GLTF attributes.
Fixed crash when loading animated triangle.

* Split GLTF model loading into separate functions for readability.

* Fixed the already working models that I broke when introducing GLTFReadValue.
Improved the example for gltf models to be able to switch between a few models.

* Removed license from screen. It is pu inside a license file anyway.

* Small improvements on the naming of functions
Removed (*model). and replaced it with model->
2021-03-14 12:09:31 +01:00
Ray
01e28263be WARNING: VERY BREAKING CHANGE: Renamed some enum values for consistency
Some enums values have been renamed to be more consistent and also provide a more detailed description:
 - ShaderLocationIndex:    LOC_VERTEX_POSITION -> SHADER_SHADER_LOC_VERTEX_POSITION
 - ShaderUniformDataType:  UNIFORM_VEC2 -> SHADER_UNIFORM_VEC2
 - MaterialMapType: MAP_ALBEDO -> MATERIAL_MAP_ALBEDO
 - PixelFormat: UNCOMPRESSED_GRAYSCALE -> PIXELFORMAT_UNCOMPRESSED_GRAYSCALE
2021-03-14 11:05:51 +01:00
Hristo Stamenov
5c2983f510
Gltf model and animations exploring problems (#1635)
* Added bone binding to whole mesh and not only set vertices.
+ Also added missed setting of the animation count.
+ Removed double ; on one line

* Added more of the gltf sample models

https://github.com/KhronosGroup/glTF-Sample-Models
We need to make it working for all of them.

* Binding to initial bind pose added.

* Fix cube disappearing bug because lerpPercent could be Inf.

* Fixed for rigged figure also
2021-03-09 00:11:08 +01:00
Ray
01b3c97c42 Some misc tweaks 2021-03-02 02:03:52 +01:00
Ray
2ff5fa73e9 REVIEWED: rlUnloadMesh() #1615 2021-03-02 00:34:10 +01:00
Chris Sinclair
84ab4ce007
Patch up GLTF Skeleton loading (#1610)
* Add support for u8 bone indicies when loading glTF

* Fix segfault for glTF animations not keyframed at 0

When loading glTF animations we lerp between keyframes, and previously
assume that if the frame we are considering has a later keyframe, there
must be a previous keyframe. This is not true if the animation's first
keyframe is some time into the animation. In this case we now
effectively clamp to that first keyframe for any time prior to it.

* Respect parent bones tranform when loading glTF animations

We previously assumed that when loading glTF animations, the bones were
ordered with those higher up the skeleton tree (i.e. closer to the root)
came first in the list of nodes. This may not be true, so now we
repeatedly loop, preparing each level of the skeleton tree one after the
other, starting at the root level. This ensures that any parent
transforms are applied before transforming any child bones.

We also ensure that we have forced the loading of animation data before
attempting to interpolate to generate the animation frames for use
later, without this no animations are applied.

Finally we remove the check that assumed the first node in the nodes
list is the root, and use an invalid index value as the sentinal value
for when a node has no parent. Previously this was 0, which made
distinguishing between root nodes and children of the first node
impossible.
2021-02-24 09:25:20 +01:00
Ray
ef8318f5e3 [models] Move vboId ALLOC/FREE to rlgl module #1603
Actually, it seems more logical that rlgl takes care of OpenGL data than the models module...

Also, models module loaded vertex data is unloaded by models module.
2021-02-21 12:09:52 +01:00
Jeffery Myers
eb47cc5e93
Fix warnings generated by Visual Studio 2019 in new model loading code. (#1600)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-02-20 19:42:32 +01:00
Jeffery Myers
0f5aab3a1c
check to make sure parent bone is not null before trying to compute its offset from the root (#1594) 2021-02-16 10:29:00 +01:00
raysan5
9619e5cbf8 Review some warnings and formatting 2021-02-09 13:23:06 +01:00
raysan5
b2215cf017 REVIEWED: Replace GetImageData() by LoadImageColors() 2021-02-06 13:29:22 +01:00
raysan5
0f309b9b16 REMOVED: MeshNormalsSmooth() #1421
Current implementation is probably wrong and it should be reimplemented from scratch, in the meantime, I prefer to remove the function.
2021-02-05 19:49:05 +01:00
hristo
c8e427ad23
Update loading of gltf animation. (#1561)
This is to account for GLTF info being more like instructions on how to build your animation instead of verbose description of each pose.
2021-02-02 10:49:42 +01:00
hristo
731ab15d57
Gltf animation support (#1551)
* Added example for gltf animation and split some functions for loading model animations into IQM and GLTF similar to how models are being loaded.

* Removed wrongly duplicated function

* Bone loading for gltf model (not working at this point)

* Loading info about vertex to joint connection but animation is still not working

* Skeleton and pose is correctly loaded. Need to communicate about interpolation in GLTF

* The model almost looks like a real person on animation.

* Fixed model loading with bones.

Also updated license info on the model.

* Cleaned up some code and updated examples.

* Fix identation issues

* Fix identation issues

* Fix identation issues
2021-01-28 11:29:06 +01:00
Ray
f4f208c4ae ADDED: UploadMesh() #1529
Upload mesh data to GPU and get VAO/VBO identifiers
2021-01-22 12:16:19 +01:00
hristo
551597d579
Removed a repeating allocation of memory (#1507)
Resolves #1495
This line allocated some memory that was already allocated in the beginning of the function and was essentially creating a leak.
2021-01-03 22:43:09 +01:00
raysan5
d7b4b9e485 Update year to 2021 2021-01-02 18:15:13 +01:00
Victor Gallet
03278a74bf
Avoid dereferencing a null pointer in the 'LoadMaterials' function in the models module (#1498) 2020-12-31 13:28:53 +01:00
raysan5
ea0f6c7a26 Replace TABS by 4 spaces 2020-12-24 23:07:52 +01:00
raysan5
0a9e080998 Remove trailing spaces 2020-12-23 15:03:26 +01:00
Ray
9097d0b4ef REVIEW: CheckCollisionSpheres() params naming 2020-12-19 20:05:32 +01:00
Ray
2374281204 Avoid *Rec suffix in some variables
Pefixing/Suffixing some data type identifier in the variables is not a convention used in raylib, just reviewed it for consistency...

Still, I kept the *Rec suffix in some functions.
2020-12-19 19:27:31 +01:00
Ray
e69f2f0c26 REVIEWED: DrawGrid(), issue with buffer limits check #1417 2020-12-14 23:39:12 +01:00
Ray
cd3eb3d8bd Added some security checks on GenMesh*() #1454 2020-12-14 20:41:58 +01:00
Jeffery Myers
7a0e73331d
Add mesh collision function so we can check meshes directly instead of having to put them in a model. (#1459)
Make model collision function call the mesh function.
2020-12-14 19:26:32 +01:00
Ray
d1119816d7 Review comment 2020-12-03 20:16:46 +01:00
Ray
60928ec82c ADDED: UnloadModelKeepMeshes() #1441 2020-12-01 23:44:10 +01:00