Ray
186d34827a
Align LINES and TRIANGLES drawing
...
When drawing LINES or TRIANGLES, vertex are accumulated in same buffer as QUADS and new draw calls are registered but QUADS drawing uses an index buffer for optimization, so, when adding LINES/TRIANGLES vertices we need to make sure next draw calls for QUADS keep aligned with indices buffer.
To get that we just add some alignment vertex at the end of the LINES/TRIANGLES draw calls, to make them multiple of 4 vertex.
2019-03-28 18:05:32 +01:00
Ray
477ea4d660
Support external config flags
2019-03-12 16:00:26 +01:00
Ray
36fa0207f2
Some spacing review
2019-02-28 23:06:37 +01:00
Ray
d679a97e92
Removed some NULL pointer checks
2019-02-28 18:39:58 +01:00
Ray
b570b32337
Added some comments on #594
2019-02-28 16:28:49 +01:00
Ray
374811c440
Change ternary operator formatting
2019-02-22 13:13:11 +01:00
Ray
641895b5ba
Remove end-line spaces
2019-02-21 18:45:19 +01:00
Ray
366313bfd0
Update rlgl.h
2019-02-06 18:07:34 +01:00
Ray
68a2bf0e6b
Update rlgl.h
2019-02-06 17:35:26 +01:00
Ray
7370ae7b82
Update rlgl.h
2019-02-06 16:51:36 +01:00
Ray
d356b1d1cc
Reviewed fbo creation and VR system
2019-02-06 14:21:44 +01:00
Ray
db56d432e4
ADDED: rlLoadTextureDepth()
...
REDESIGNED: rlLoadRenderTexture()
ADDED: rlRenderTextureAttach()
ADDED: rlRenderTextureComplete()
2019-02-04 16:28:17 +01:00
Ray
fce48e85f4
ADDED: LoadTextureCubemap()
...
Probably uncomplete, not tested yet...
2019-02-04 13:27:36 +01:00
Marco Lizza
aaced97b12
Fixing badly (redefined) enums.
2019-01-21 10:02:53 +01:00
Marco Lizza
c1c801e5c3
Reworking log level as incremental.
2019-01-20 22:22:21 +01:00
Ray
ced7321089
Readded alpha clear to rlReadScreenPixels()
...
When capturing framebuffer, if some element with transparency has been drawn, it retrieves that data... it could be a bit annoying in some situations because we could expect color compositing with background color... It depends on the situation and our needs... but most of the time we don't want that transparency on screenshots.
2019-01-16 10:04:59 +01:00
Ray
f1bcc131dc
Let user choose to clear scissor area
2019-01-15 12:08:11 +01:00
Ray
49a69e3e27
Allow capturing transparent background
2019-01-11 18:55:04 +01:00
Ray
64fd131ed5
Some improvements on SetShaderValue()
...
- Unsigned int not supported on OpenGL ES 2.0 -> Removed
- Reorganized enum -> Removed BOOL (not uniformType)
- Support sample2D uniform type
2019-01-10 12:28:23 +01:00
Ray
55f8dbc755
WARNING: Redesigned SetShaderValue()
2019-01-10 11:25:26 +01:00
Ray
35bcbd1b60
Merge pull request #718 from MarcoLizza/shaders-uniforms-array
...
Shaders uniforms array
2019-01-09 17:01:59 +01:00
Marco Lizza
73597332b6
Adding uniform array support for shaders.
2019-01-09 16:18:00 +01:00
raysan5
1036de389a
Some minor tweaks analyzing code
...
Specific textures generation code is quite redundant and not flexible for the user, I'm trying to figure out some easy way to allow raylib users to do the same without needing those functions (very specific and shader dependant). RenderTexture loading and Cubemap textures support must be improved.
2019-01-06 21:07:09 +01:00
raysan5
f4fe7f4d4c
Review BRDF texture generation
...
Actually, that function should be redesigned...
2019-01-06 15:49:29 +01:00
raysan5
5c614f6975
Some code tweaks
2019-01-05 19:24:42 +01:00
raysan5
a072385c6d
Corrected issue on draws resetting
2018-12-29 00:00:52 +01:00
raysan5
af4a177af4
Corrected issue with internal buffer
...
Problem aligning provided vertex data to multiples of four, because main buffer is intended to bu used with indexed quads... but also shared with triangles and lines.
2018-12-26 10:34:45 +01:00
raysan5
7b8965eb38
Support float texture data on OpenGL ES 2.0
2018-12-25 15:19:25 +01:00
raysan5
7fb2459916
Added some TODO note
...
OpenGL extensions loading could be improved...
2018-12-24 17:45:34 +01:00
raysan5
47358fe5ce
Tweaks to support OpenGL ES 2.0 desktop
2018-12-24 17:09:46 +01:00
raysan5
92f68ac6be
Review DrawPolyEx()
...
Also reviewed rlCheckBufferLimit()
2018-12-24 14:09:51 +01:00
Ray
788bb78989
Some tweaks
2018-12-20 10:40:28 +01:00
Ray
b6d2f96645
Corrected issue
2018-12-19 18:08:59 +01:00
Ray
af33e3848e
Improved BeginScissorMode()
...
Now rectangle coordinates refer to upper-left corner instead of bottom-left
2018-12-19 17:06:23 +01:00
Ray
39c05e30d0
Reviewed rlReadTexturePixels() for OpenGL ES 2.0
...
Now it should work... but this behaviour could be driver dependant...
2018-12-18 18:20:20 +01:00
Ray
db96cf4a8b
Corrected bug on OpenGL ES quads drawing
2018-12-18 16:52:18 +01:00
Ray
4008a075a8
Added scissor functionality
...
To draw only in defined area of the screen
ADDED: BeginScissorMode(), EndScissorMode()
2018-12-15 23:30:55 +01:00
Ray
cbbd67ab5a
Some code tweaks
...
- Reorganized some variables: Not used on OpenGL 1.1
- Now mipmaps can be generated on OpenGL 1.1 backend
- Renamed whiteTexture to defaultTextureId
2018-12-14 10:00:44 +01:00
Ray
97e40ced57
WARNING: BIG rewrite of rlgl module
...
This commit implements a big update of rlgl module, intended to optimize some parts. This change could break some code bases... hopefully not, but it could.
The BIG changes to the module are:
- Replaced LINES-TRIANGLES-QUADS buffers by a single one, now all vertex data is accumulated on a single buffer and managed with registered draw calls. LINES-TRIANGLES-QUADS could be used the same way as before, rlgl will manage them carefully. That's a big improvement of the system.
- Support multi-buffering if required. Just define MAX_BATCH_BUFFERING desired size (currently set to 1 batch). Should be enough for most of the situations.
- Removed temporal accumulative buffers for matrix transformations, now transformations are directly applied to vertex when on rlVertex3f()
- Reviewed rlPushMatrix()/rlPopMatrix() to be consistent with OpenGL 1.1, probably I should remove that ancient behaviour but... well, it was not consistent and now it is.
- Minor tweaks: LoadText(), I broke it in last update... also multiple comments reviewed.
- TODO: MAX_BATCH_ELEMENTS checking should probably be reviewed... done some tests and it works but...
2018-12-11 18:54:48 +01:00
Ray
8b75a1a990
Improved textures wrap support
2018-12-03 12:00:05 +01:00
Ray
ab0287bd4e
Some tweaks to LoadText()
2018-11-28 12:34:03 +01:00
Ray
0bf82ff6f4
free memory for extList
2018-11-27 12:23:41 +01:00
Ray
fc1c9505ba
Remove end-line spaces
2018-11-06 15:10:50 +01:00
Ray
bd383fe219
Tweak for OpenGL 2.1
...
Why am I still supporting this???
2018-10-20 12:48:03 +02:00
Ray
1f4866276a
Corrected typo
2018-10-19 21:50:50 +02:00
Ray
16914dfaa2
Reviewed possible issue with...
...
...disposing RenderTexture.
2018-10-19 21:40:34 +02:00
Ray
b8b8936cd7
Review defines
2018-10-16 10:53:01 +02:00
Ray
126ab49221
Minor tweaks
2018-10-10 23:55:36 +02:00
Ray
d67edb591a
Support KXT image file export
...
[textures] Added SaveKTX()
[rlgl] Exposed rlGetGlTextureFormats()
2018-10-01 15:30:48 +02:00
Ray
506b7b8d7c
Corrected issue with batch overflows
...
When a batch reach its vertex limit, a draw call is issued and batch restarted for refilling but if the draw call was issued for vertex data accumulated inside rlPushMatrix/rlPopMatrix, draw call was issued before the rlPopMatrix, consequently modelview matrix was not properly recovered before the draw call... obviously, it only happened the following draw calls, not the first one...
Now it works ok but this system needs to reviewed, noticed and important frames drop when processing around 20 dynamic batch draw calls, it means filling MAX_QUADS_BATCH (8192) quads of data 20 times per frame, including data updating and sending for draw processing.
Doing some maths, it means:
Vertex data (float) -----> 8192 quads * 4 vertex * 3 comp * 4 byte = 393216 bytes
Texcoords data (float) -> 8192 quads * 4 vertex * 2 comp * 4 byte = 262144 bytes
Color data (uchar) -----> 8192 quads * 4 vertex * 4 comp * 1 byte = 131072 bytes
Thats a total of 786432 bytes (0.75MB) sent to GPU 20 times per frame for processing... I'm testing in an Intel HD Graphics integrated, I imagine is too much data to be sent and and it causes stalls, so the frames drop...
2018-08-17 13:55:46 +02:00
Ray
732b775a1d
Proper variables initialization
2018-08-17 11:41:49 +02:00
Ray
4c84208644
Working on batch reset issue
...
Corrected memory leak!
2018-08-17 01:34:45 +02:00
Kim Kulling
f5f7ed79b8
Fix compiler warnings of lib
2018-08-05 23:53:34 +02:00
Kim Kulling
b2cac82fa0
Fix compiler warings in texture.c and more.
2018-08-05 00:34:35 +02:00
Pablo Marcos Oltra
8d134edaf7
Fix rlgl.h to be used as a standalone
2018-07-25 10:36:18 +02:00
Ray
361d878b4c
Updated animations support
2018-07-24 18:52:56 +02:00
Ray
198a023527
First working version of IQM animations
...
Still a work in progress but it already works...
Current riqm API could be simplified...
2018-07-24 18:28:58 +02:00
Ray
103044926b
Avoid config.h in standalone mode
2018-07-16 19:24:40 +02:00
Ray
5b37178af9
Reviewed rlgl_standalone example
2018-07-16 18:22:03 +02:00
Ray
096fd6f2c3
Converted rlgl module in header-only
...
This change allows rlgl.h usage as independent single-file header-only module... still some tweaks required, like removing GLAD dependency... required extensions could be manually loaded!
Also removed shader_distortion.h, embedded in rlgl.h
2018-07-16 17:53:47 +02:00
Ray
d0166c9d45
Spacing tweaks
2018-06-30 21:56:26 +02:00
raysan5
ca69068814
Added function: rlCheckBufferLimit()
2018-05-20 01:55:46 +02:00
Ahmad Fatoum
1841afad11
Refactor all #define SUPPORT_* into a config.h
...
That way, a user needs only to touch a single file to configure what
features raylib is built with.
Include guards are left out intentionally, because config.h should only
be included in source files, not headers.
Later on, config.h can also define the raylib version (#461 ).
2018-04-07 23:37:48 +02:00
raysan5
a0127d8300
Corrected typo
2018-03-11 10:49:51 +01:00
Ray
077bef4286
Support 4 components mesh.tangent data
...
Added struct Vector4 for convenience
2018-02-24 12:31:32 +01:00
raysan5
7caa3201d5
Improved pixel formats support
...
- Renamed enum TextureFormat to PixelFormat for consistency
- Added support for pixel format UNCOMPRESSED_R32
- Using GetPixelDataSize() where required
2018-01-06 13:43:48 +01:00
raysan5
b19e155b34
Support UNCOMPRESSED_R32G32B32A32 texture format
2017-12-28 17:58:37 +01:00
Ray San
e8bb53ed35
Corrected issue on OpenGL ES compilation
2017-12-20 12:35:12 +01:00
Ray San
53ad53d051
Manually review previous PR
2017-12-15 13:44:31 +01:00
user
0e18b14605
added debug-event-markers for opengl so that you're able to set markers for renderdoc or other gpu debuggers what your program is currently doing
2017-12-14 11:44:48 +01:00
user
963551ee6e
added possibility to get modelview matrix from rlgl to be able to send it to shaders
2017-12-14 11:43:06 +01:00
user
69c8fa409a
fixed function declaration differ from implementation
2017-12-14 11:42:06 +01:00
raysan5
02dd4d32b5
Allow custom distortion shader - IN PROGRESS -
2017-11-12 11:00:28 +01:00
Ray San
7057d08369
Review VR functionality
...
To be more generic and configurable
2017-10-17 13:32:15 +02:00
Ray San
ddea9d68bf
Review VR simulator
...
Requires some work, distortion shader could be move out of raylib to
example code...
2017-10-04 12:11:40 +02:00
raysan5
e52032f646
Complete review of raymath
...
Now it should be coherent with OpenGL math standards
2017-07-21 17:19:28 +02:00
raysan5
38d9fcb08e
Moved some functions to raymath
...
Exposed some raymath useful functions to raylib API
2017-07-21 15:25:35 +02:00
raysan5
980d9d4cd4
rlgl usable as standalone library
2017-07-21 10:42:57 +02:00
raysan5
0dabb2708b
Reorganized a couple of functions
2017-07-19 19:53:53 +02:00
raysan5
d368403a13
Working on PBR materials, renamed some data
2017-07-19 10:09:34 +02:00
Ray
6546474fa4
Manual integration of material-pbr into develop
2017-07-17 00:33:40 +02:00
raysan5
8ca8550739
Removed function reference
2017-07-08 14:22:48 +02:00
raysan5
9f09f6f550
Rename enum LogType names...
...
...to avoid possible conflicting symbols
2017-07-02 12:35:13 +02:00
Ray
50c887cb0a
Support HDR R32G32B32 float textures loading
2017-05-08 12:31:47 +02:00
Ray
822c2ddad5
Some defines tweaks for consistency
2017-05-08 02:47:44 +02:00
Ray
39732d04ec
Comments review
2017-05-08 00:55:26 +02:00
Ray
d593bd0081
Some code tweaks
2017-04-30 13:03:31 +02:00
raysan5
247da006ae
Rename parameter
2017-04-22 22:35:04 +02:00
Ray
59652c75b4
Review some comments
2017-03-20 20:34:44 +01:00
raysan5
5d1f661661
Remove Oculus support from code
...
Moved to custom example, now raylib only supports simulated VR
rendering.
Oculus code was too device dependant... waiting for OpenXR.
2017-03-14 01:05:22 +01:00
Ray San
836c1636a2
Remove lighting system from rlgl standalone header
2017-02-08 20:02:40 +01:00
Ray
f164ec80d6
Upload wave collector - GGJ17 game
2017-01-22 15:31:56 +01:00
raysan5
852f3d4fd0
Review comments and formatting
2016-12-25 02:01:13 +01:00
Ray
f1bcfc1352
Corrected bug on GenTextureMipmaps()
...
texture.mipmaps value needs to be updated, so, texture must be passed by
reference instead of by value
2016-11-22 12:14:55 +01:00
raysan5
bee283b12b
Some tweaks around
2016-11-17 12:55:30 +01:00
raysan5
6d1b712a96
Reviewed modules comments
2016-11-16 18:46:13 +01:00
raysan5
9d3ad52160
Removed byte typedef
2016-11-15 19:15:25 +01:00
raysan5
988d39029f
Support textures filtering
2016-10-29 22:17:19 +02:00
raysan5
4ff98f34bb
Function to set texture parameters -IN PROGRESS-
2016-10-27 13:40:48 +02:00
raysan5
d5e0f4e84e
Added notes on vr tracking -> camera update
2016-10-17 17:02:33 +02:00
raysan5
5fecf5c088
Review UpdateVrTracking() and rlglLoadRenderTexture()
2016-10-10 19:42:59 +02:00
raysan5
36f20376e6
Redesigned lighting shader system
2016-09-05 20:15:21 +02:00
raysan5
959a228815
Removed useless spacing
2016-08-16 11:09:55 +02:00
raysan5
16ac468bdb
Remove functions from user exposure
2016-08-06 19:30:41 +02:00
raysan5
5ff9811ea8
Some code tweaks
2016-07-18 17:06:33 +02:00
raysan5
55b9a2479a
Expose Oculus Rift functionality directly
2016-07-16 22:41:13 +02:00
raysan5
bfb5ffedda
Added rlgl standalone sample
2016-07-16 19:25:15 +02:00
raysan5
7cefbd8a94
Updated lighting system...
...
...to avoid dynamic conditions on for loop (lightsCount) on standard
shader, it seems GLSL 100 doesn't support that feature... on some GPUs
like RaspberryPi...
2016-07-06 20:33:46 +02:00
Ray
bc80174357
VR Functions renaming (for generic HMD device)
...
Stereo rendering has been moved again to Begin3dMode() and End3dMode(),
it has some limitations but makes more sense...
2016-07-06 00:54:38 +02:00
Ray
ee72654b55
Redesigned stereo rendering mechanism
...
Now it's easier for the user! Just init Oculus device and get stereo
rendering!
2016-07-04 01:29:23 +02:00
raysan5
9127b5a57d
Enable/Disable VR experience
2016-06-26 15:36:12 +02:00
raysan5
8652e644dd
Corrected bug on stereo rendering
2016-06-26 14:13:11 +02:00
raysan5
71ab202295
Removed rlglInitGraphics(), integrated into rlglInit()
...
Redesigned rlgl usage:
- rlViewport() must be called by user
- Internal projection/modelview matrices must be setup by user
2016-06-25 23:28:50 +02:00
raysan5
03d9583b94
Add oculus simulator (in case device is not detected)
2016-06-21 13:49:13 +02:00
Ray
6062201e8f
Simplify Oculus example...
...
...to align it with standard raylib code. Final goal would be having the
same code work for every platform with no changes...
2016-06-21 08:59:29 +02:00
raysan5
b01f5ff6a7
Starting work on VR simulator support
...
If Oculus device is not available or not initialized correctly,
simulated VR view is generated using stereo-rendering and distortion
2016-06-19 19:12:47 +02:00
Ray
24c9b1f717
Improving Oculus Rift example...
...
Under design... looking for the easiest and most comprehensive way for
the user to use VR...
2016-06-17 13:54:45 +02:00
Ray
4df7a0f2f8
Added support for OpenGL 2.1
2016-06-16 20:25:50 +02:00
raysan5
3ce0228206
Move Oculus Rift support to rlgl module
2016-06-14 17:16:20 +02:00
raysan5
c25b4cdc69
Move OpenGL extensions loading to rlgl
2016-06-14 15:42:04 +02:00
Ray
ee795150fa
Updated some code
2016-06-07 23:44:53 +02:00
raysan5
0bc71d84f8
Added functions to customize internal matrix
...
Internal modelview and projection matrices can be replaced before
drawing.
2016-06-02 20:23:09 +02:00
Ray
17878550b1
Review heades usage
...
This is a first step toward a bigger project. Some modules could be
ported to header-only to be used as standalone.
2016-06-02 01:26:44 +02:00
raysan5
d17a0cee1a
Review text formatting (spacing, tabs...)
2016-05-31 19:12:37 +02:00
raysan5
302ec438dd
Removed colTint, tint color is colDiffuse
...
Tint color could be applied to colDiffuse... but what's the best way?
Replace it? Multiply by? A point to think about...
2016-05-31 18:15:53 +02:00
raysan5
cac2a66deb
Improved library consistency
...
Functions renamed to improve library consistency
2016-05-31 17:11:02 +02:00
victorfisac
b0a0c5d431
Added tint color attribute to material data type
...
It tints all fragments, ignores lighting. Useful for some features like
feedback (damage color, ...).
2016-05-30 19:55:13 +02:00
victorfisac
f2d61d4043
Remove normal depth
...
Scaling normal depth (y axis) makes disappear the specular of
fragments... So I think it can be removed, it is not a very
useful/important attribute.
2016-05-30 19:43:35 +02:00
victorfisac
2e26ce235d
Add Draw3DCircle function and update raylib and rlgl header
...
Draw3DCircle is useful to draw point lights radius.
2016-05-30 19:18:11 +02:00
raysan5
ea5b00528b
Improved render to texture
...
Support render texture size different than screen size
2016-05-29 11:49:13 +02:00
raysan5
d53b6f4381
Renamed shader variables (more generic names)
...
Now shader maps use a generic naming convention for any kind of texture
maps (not only diffuse, normal or specular). Useful for custom shaders.
2016-05-25 16:19:57 +02:00
victorfisac
c320a21f2b
Add standard lighting (2/3)
...
- 3 light types added (point, directional, spot).
- DrawLights() function added using line shapes.
- Standard lighting example added.
- Removed useless struct variables from material and light.
- Fixed light attributes dynamic locations errors.
- Standard vertex and fragment shaders temporally added until rewrite it
as char pointers in rlgl.
TODO:
- Add normal and specular maps calculations in standard shader.
- Add control structs to handle which attributes needs to be calculated
(textures, specular...).
- Adapt standard shader to version 110.
- Rewrite standard shader as char pointers in rlgl.
2016-05-21 18:16:39 +02:00
raysan5
dcf5f45f68
Add lighting system -IN PROGRESS-
...
Improved materials
2016-05-20 12:28:07 +02:00
raysan5
7d1d9ff143
Support DYNAMIC_DRAW mesh loading
2016-05-20 09:36:02 +02:00
raysan5
037edbaa13
Reorganize data for consistency
2016-05-18 13:22:14 +02:00
raysan5
075f51e0a3
Simplified internal (default) dynamic buffers
2016-05-12 12:20:23 +02:00
raysan5
4d78d27bd9
Updated structs Mesh and Shader
2016-05-11 19:25:51 +02:00
raysan5
7ab008878a
Library redesign to accomodate materials system
2016-05-07 18:07:15 +02:00
raysan5
8301980ba8
Clean up and consistency review
...
- Renamed some functions for consistency (default buffers)
- Removed mystrdup() function (implemented inline)
- Renamed TextFileRead() to ReadTextFile()
2016-05-03 19:20:25 +02:00
raysan5
06a8d7eb06
Remove old postprocessing system
2016-04-01 10:39:33 +02:00
raysan5
66b096d978
Added support for render to texture (use RenderTexture2D)
...
Now it's possible to render to texture, old postprocessing system will
be removed on next raylib version.
2016-03-30 20:09:16 +02:00
raysan5
5e45c3c824
Redesign to work as standalone
...
Redesigned to work as standalone and support fordward-compatible context
(shaders review)
2016-03-20 13:39:27 +01:00
Ray
e2ba22ec59
Improved 2D-3D drawing
...
Depth test disabled for 2D and only used on 3D; consequently LINES vs
TRIANGLES vs QUADS buffers drawing order maters... but blending also
works ok.
2016-03-17 13:51:48 +01:00
raysan5
c9d22c7a14
Redesign to use Material type -IN PROGRESS-
...
Requires Shader access functions review
2016-03-06 02:05:16 +01:00
Ray
df5c64d0be
Functions parameters reorganize: Axis and Angle
...
sin(), cos() functions cached and replaced by float c99 versions sinf(),
cos()
2016-02-02 18:41:01 +01:00
raysan5
d0ff78e7f4
Move Light struct to example
2016-01-25 13:39:23 +01:00
raysan5
68ba34c17b
Updated struct types
2016-01-21 01:03:43 +01:00
raysan5
efa1c96d19
Adapted raymath as single header library
...
Added support for single header implementation and also inline functions
support
2016-01-20 18:20:05 +01:00
raysan5
fd05d3e353
Rename VertexData struct to Mesh
...
Reviewed vertex type variables
2016-01-18 13:36:18 +01:00
raysan5
fb6ef2c2f4
Vertex shaders optimization
2016-01-13 17:13:28 +01:00