Skip to content

Commit 590f441

Browse files
committed
update r3d and build script
1 parent 9c8b349 commit 590f441

File tree

11 files changed

+51
-148
lines changed

11 files changed

+51
-148
lines changed

build/build_r3d.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
rm -rvf r3d
2+
#rm -rvf r3d
33
rm -f ../libs/x86_64-linux/libr3d*
44
rm -f ../libs/x86_32-linux/libr3d*
55
rm -f ../libs/x86_64-win64/libr3d*
@@ -19,27 +19,27 @@ cd build
1919

2020
rm -rf *
2121
echo "Build x86_64_LINUX statics"
22-
cmake -DR3D_BUILD_EXAMPLES=OFF ..
22+
cmake -DR3D_BUILD_EXAMPLES=OFF -DR3D_RAYLIB_VENDORED=ON ..
2323
cmake --build .
2424
cp libr3d.a ../../../libs/x86_64-linux/libr3d.a
2525

2626
rm -rf *
2727
echo "Build x86_32_Linux statics"
28-
cmake -DR3D_BUILD_EXAMPLES=OFF -D CMAKE_CXX_FLAGS=-m32 ..
28+
cmake -DR3D_BUILD_EXAMPLES=OFF -DR3D_RAYLIB_VENDORED=ON -D CMAKE_CXX_FLAGS=-m32 ..
2929
cmake --build .
3030
cp libr3d.a ../../../libs/x86_32-linux/libr3d.a
3131

3232

3333
rm -rf *
3434
echo " build x64 windows"
35-
cmake -DCMAKE_TOOLCHAIN_FILE=mingw-w64-x86_64.cmake -DR3D_BUILD_SHARED=ON -DR3D_BUILD_RAYLIB_SHARED=ON -DR3D_BUILD_EXAMPLES=OFF ..
35+
cmake -DCMAKE_TOOLCHAIN_FILE=mingw-w64-x86_64.cmake -DR3D_BUILD_SHARED=ON -DR3D_RAYLIB_VENDORED=ON -DR3D_BUILD_EXAMPLES=OFF ..
3636
cmake --build .
3737
cp libr3d.dll ../../../libs/x86_64-win64/libr3d.dll
3838
#cp libr3d.dll.a ../../../libs/x86_64-win64/libr3d.dll.a
3939

4040
rm -rf *
4141
echo " build x32 windows"
42-
cmake -DCMAKE_TOOLCHAIN_FILE=mingw-w32-x86_64.cmake -DR3D_BUILD_SHARED=ON -DR3D_BUILD_RAYLIB_SHARED=ON -DR3D_BUILD_EXAMPLES=OFF ..
42+
cmake -DCMAKE_TOOLCHAIN_FILE=mingw-w32-x86_64.cmake -DR3D_BUILD_SHARED=ON -DR3D_RAYLIB_VENDORED=ON -DR3D_BUILD_EXAMPLES=OFF ..
4343
cmake --build .
4444
cp libr3d.dll ../../../libs/i386-win32/libr3d.dll
4545
#cp libr3d.dll.a ../../../libs/i386-win32/libr3d.dll.a

headers/extras/r3d.h

+25-73
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,15 @@ typedef enum {
144144
/**
145145
* @brief Bloom effect modes.
146146
*
147-
* Defines different post-processing bloom effects applied to the rendered scene.
148-
*/
149-
typedef enum {
150-
R3D_BLOOM_DISABLED, ///< Bloom effect is disabled.
151-
R3D_BLOOM_ADDITIVE, ///< Enhances bright areas by adding light to them (stronger glow effect).
152-
R3D_BLOOM_SOFT_LIGHT ///< Creates a softer, more diffused glow around bright areas.
147+
* Specifies different post-processing bloom techniques that can be applied
148+
* to the rendered scene. Bloom effects enhance the appearance of bright areas
149+
* by simulating light bleeding, contributing to a more cinematic and realistic look.
150+
*/
151+
typedef enum {
152+
R3D_BLOOM_DISABLED, ///< Bloom effect is disabled. The scene is rendered without any glow enhancement.
153+
R3D_BLOOM_MIX, ///< Blends the bloom effect with the original scene using linear interpolation (Lerp).
154+
R3D_BLOOM_ADDITIVE, ///< Adds the bloom effect additively to the scene, intensifying bright regions.
155+
R3D_BLOOM_SCREEN ///< Combines the scene and bloom using screen blending, which brightens highlights
153156
} R3D_Bloom;
154157

155158
/**
@@ -1530,64 +1533,26 @@ R3DAPI void R3D_SetBloomIntensity(float value);
15301533
R3DAPI float R3D_GetBloomIntensity(void);
15311534

15321535
/**
1533-
* @brief Sets the HDR threshold for bloom.
1536+
* @brief Sets the bloom filter radius.
15341537
*
1535-
* This function defines the brightness threshold above which pixels contribute
1536-
* to the bloom effect. Lower values will make more areas of the image glow.
1538+
* Controls the radius of the blur filter applied during the upscaling stage
1539+
* of the bloom effect. A larger radius results in a wider glow around bright
1540+
* objects, creating a softer and more diffuse bloom. A value of 0 disables
1541+
* the filtering effect, preserving sharp bloom highlights.
15371542
*
1538-
* @param value The HDR threshold for bloom.
1543+
* @param value The radius of the bloom filter (in pixels or arbitrary units depending on implementation).
15391544
*/
1540-
R3DAPI void R3D_SetBloomHdrThreshold(float value);
1541-
1542-
/**
1543-
* @brief Gets the current HDR threshold for bloom.
1544-
*
1545-
* This function retrieves the brightness threshold above which pixels contribute
1546-
* to the bloom effect.
1547-
*
1548-
* @return The current HDR threshold for bloom.
1549-
*/
1550-
R3DAPI float R3D_GetBloomHdrThreshold(void);
1551-
1552-
/**
1553-
* @brief Sets the HDR threshold for the sky in bloom.
1554-
*
1555-
* This function defines a separate HDR threshold for the sky when applying bloom.
1556-
* This allows finer control over the intensity of the bloom effect on sky elements.
1557-
*
1558-
* @param value The HDR threshold for bloom on the sky.
1559-
*/
1560-
R3DAPI void R3D_SetBloomSkyHdrThreshold(float value);
1561-
1562-
/**
1563-
* @brief Gets the current HDR threshold for bloom on the sky.
1564-
*
1565-
* This function retrieves the HDR threshold specifically applied to the sky for bloom.
1566-
*
1567-
* @return The current HDR threshold for sky bloom.
1568-
*/
1569-
R3DAPI float R3D_GetBloomSkyHdrThreshold(void);
1570-
1571-
/**
1572-
* @brief Sets the number of iterations for the bloom effect.
1573-
*
1574-
* This function defines how many iterations are performed to blur the bright areas.
1575-
* Higher values result in a smoother and more pronounced bloom effect but may
1576-
* impact performance.
1577-
*
1578-
* @param value The number of bloom iterations.
1579-
*/
1580-
R3DAPI void R3D_SetBloomIterations(int value);
1581-
1582-
/**
1583-
* @brief Gets the current number of bloom iterations.
1584-
*
1585-
* This function retrieves the number of iterations used to process the bloom effect.
1586-
*
1587-
* @return The current number of bloom iterations.
1588-
*/
1589-
R3DAPI int R3D_GetBloomIterations(void);
1545+
R3DAPI void R3D_SetBloomFilterRadius(int value);
15901546

1547+
/**
1548+
* @brief Gets the current bloom filter radius.
1549+
*
1550+
* Retrieves the current radius used for the bloom filter. This value determines
1551+
* how far the glow effect extends around bright areas in the scene.
1552+
*
1553+
* @return The current bloom filter radius.
1554+
*/
1555+
R3DAPI int R3D_GetBloomFilterRadius(void);
15911556

15921557

15931558
// --------------------------------------------
@@ -2175,19 +2140,6 @@ R3DAPI void R3D_DrawBufferORM(float x, float y, float w, float h);
21752140
*/
21762141
R3DAPI void R3D_DrawBufferSSAO(float x, float y, float w, float h);
21772142

2178-
/**
2179-
* @brief Renders the bright colors buffer to the screen.
2180-
*
2181-
* Displays the bright color buffer, which is used for bloom effects.
2182-
* Must be called outside of `R3D_Begin` and `R3D_End`.
2183-
*
2184-
* @param x X position to draw the buffer.
2185-
* @param y Y position to draw the buffer.
2186-
* @param w Width of the drawn buffer.
2187-
* @param h Height of the drawn buffer.
2188-
*/
2189-
R3DAPI void R3D_DrawBufferBrightColors(float x, float y, float w, float h);
2190-
21912143
/**
21922144
* @brief Renders the bloom buffer to the screen.
21932145
*

libs/i386-win32/libraygizmo.dll

0 Bytes
Binary file not shown.

libs/i386-win32/libraylib.dll

0 Bytes
Binary file not shown.

libs/i386-win32/libraymedia.dll

0 Bytes
Binary file not shown.

libs/x86_32-linux/libr3d.a

682 KB
Binary file not shown.

libs/x86_64-linux/libr3d.a

682 KB
Binary file not shown.

libs/x86_64-win64/libraygizmo.dll

0 Bytes
Binary file not shown.

libs/x86_64-win64/libraylib.dll

0 Bytes
Binary file not shown.

libs/x86_64-win64/libraymedia.dll

0 Bytes
Binary file not shown.

source/extras/r3d.pas

+21-70
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ interface
101101
type
102102
R3D_Bloom = Integer;
103103
const
104-
R3D_BLOOM_DISABLED = R3D_Bloom(0); //< Bloom effect is disabled.
105-
R3D_BLOOM_ADDITIVE = R3D_Bloom(1); //< Enhances bright areas by adding light to them (stronger glow effect).
106-
R3D_BLOOM_SOFT_LIGHT = R3D_Bloom(2); //< Creates a softer, more diffused glow around bright areas.
104+
R3D_BLOOM_DISABLED = R3D_Bloom(0); // Bloom effect is disabled. The scene is rendered without any glow enhancement.
105+
R3D_BLOOM_MIX = R3D_Bloom(1); // Blends the bloom effect with the original scene using linear interpolation (Lerp).
106+
R3D_BLOOM_ADDITIVE = R3D_Bloom(2); // Adds the bloom effect additively to the scene, intensifying bright regions.
107+
R3D_BLOOM_SCREEN = R3D_Bloom(3); // Combines the scene and bloom using screen blending, which brightens highlights
108+
107109

108110
type
109111
R3D_Fog = Integer;
@@ -122,7 +124,6 @@ interface
122124
R3D_TONEMAP_ACES = R3D_Tonemap(3); //< ACES tone mapping, a high-quality cinematic rendering technique.
123125
R3D_TONEMAP_AGX = R3D_Tonemap(4); //< AGX tone mapping, a modern technique designed to preserve both highlight and shadow details for HDR rendering.
124126

125-
126127
type
127128
PR3D_Light = ^TR3D_Light;
128129
TR3D_Light = Cardinal; // Cardinal is an unsigned 32-bit integer in Pascal
@@ -1407,63 +1408,26 @@ procedure R3D_SetBloomIntensity(value: Single); cdecl; external {$IFNDEF RAY_STA
14071408
function R3D_GetBloomIntensity(): Single; cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_GetBloomIntensity';
14081409

14091410
(*
1410-
* @brief Sets the HDR threshold for bloom.
1411-
*
1412-
* This function defines the brightness threshold above which pixels contribute
1413-
* to the bloom effect. Lower values will make more areas of the image glow.
1414-
*
1415-
* @param value The HDR threshold for bloom.
1416-
*)
1417-
procedure R3D_SetBloomHdrThreshold(value: Single); cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_SetBloomHdrThreshold';
1418-
1419-
(*
1420-
* @brief Gets the current HDR threshold for bloom.
1421-
*
1422-
* This function retrieves the brightness threshold above which pixels contribute
1423-
* to the bloom effect.
1424-
*
1425-
* @return The current HDR threshold for bloom.
1426-
*)
1427-
function R3D_GetBloomHdrThreshold(): Single; cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_GetBloomHdrThreshold';
1428-
1429-
(*
1430-
* @brief Sets the HDR threshold for the sky in bloom.
1431-
*
1432-
* This function defines a separate HDR threshold for the sky when applying bloom.
1433-
* This allows finer control over the intensity of the bloom effect on sky elements.
1434-
*
1435-
* @param value The HDR threshold for bloom on the sky.
1436-
*)
1437-
procedure R3D_SetBloomSkyHdrThreshold(value: Single); cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_SetBloomSkyHdrThreshold';
1438-
1439-
(*
1440-
* @brief Gets the current HDR threshold for bloom on the sky.
1441-
*
1442-
* This function retrieves the HDR threshold specifically applied to the sky for bloom.
1443-
*
1444-
* @return The current HDR threshold for sky bloom.
1445-
*)
1446-
function R3D_GetBloomSkyHdrThreshold(): Single; cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_GetBloomSkyHdrThreshold';
1447-
1448-
(*
1449-
* @brief Sets the number of iterations for the bloom effect.
1411+
* @brief Sets the bloom filter radius.
14501412
*
1451-
* This function defines how many iterations are performed to blur the bright areas.
1452-
* Higher values result in a smoother and more pronounced bloom effect but may
1453-
* impact performance.
1413+
* Controls the radius of the blur filter applied during the upscaling stage
1414+
* of the bloom effect. A larger radius results in a wider glow around bright
1415+
* objects, creating a softer and more diffuse bloom. A value of 0 disables
1416+
* the filtering effect, preserving sharp bloom highlights.
14541417
*
1455-
* @param value The number of bloom iterations.
1418+
* @param value The radius of the bloom filter (in pixels or arbitrary units depending on implementation).
14561419
*)
1457-
procedure R3D_SetBloomIterations(value: Integer); cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_SetBloomIterations';
1420+
procedure R3D_SetBloomFilterRadius(value: Integer); cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_SetBloomFilterRadius';
14581421

1459-
(*
1460-
* @brief Gets the current number of bloom iterations.
1461-
*
1462-
* This function retrieves the number of iterations used to process the bloom effect.
1463-
*
1464-
* @return The current number of bloom iterations.
1465-
*)
1466-
function R3D_GetBloomIterations(): Integer; cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_GetBloomIterations';
1422+
(*
1423+
* @brief Gets the current bloom filter radius.
1424+
*
1425+
* Retrieves the current radius used for the bloom filter. This value determines
1426+
* how far the glow effect extends around bright areas in the scene.
1427+
*
1428+
* @return The current bloom filter radius.
1429+
*)
1430+
function R3D_GetBloomFilterRadius(): Integer; cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_GetBloomFilterRadius';
14671431

14681432
// --------------------------------------------
14691433
// ENVIRONMENT: Fog Config Functions
@@ -2034,19 +1998,6 @@ procedure R3D_DrawBufferORM(x, y, w, h: Single); cdecl; external {$IFNDEF RAY_ST
20341998
*)
20351999
procedure R3D_DrawBufferSSAO(x, y, w, h: Single); cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_DrawBufferSSAO';
20362000

2037-
(*
2038-
* @brief Renders the bright colors buffer to the screen.
2039-
*
2040-
* Displays the bright color buffer, which is used for bloom effects.
2041-
* Must be called outside of `R3D_Begin` and `R3D_End`.
2042-
*
2043-
* @param x X position to draw the buffer.
2044-
* @param y Y position to draw the buffer.
2045-
* @param w Width of the drawn buffer.
2046-
* @param h Height of the drawn buffer.
2047-
*)
2048-
procedure R3D_DrawBufferBrightColors(x, y, w, h: Single); cdecl; external {$IFNDEF RAY_STATIC}r3dName{$ENDIF} name 'R3D_DrawBufferBrightColors';
2049-
20502001
(*
20512002
* @brief Renders the bloom buffer to the screen.
20522003
*

0 commit comments

Comments
 (0)