@@ -731,6 +731,8 @@ RLAPI void rlDrawRenderBatchActive(void); // Update and draw inter
731
731
RLAPI bool rlCheckRenderBatchLimit (int vCount ); // Check internal buffer overflow for a given number of vertex
732
732
733
733
RLAPI void rlSetTexture (unsigned int id ); // Set current texture for render batch and check buffers limits
734
+ RLAPI void rlClearActiveTextures ();
735
+ RLAPI void rlResetDrawDepth ();
734
736
735
737
//------------------------------------------------------------------------------------------------------------------------
736
738
@@ -781,7 +783,6 @@ RLAPI void rlSetUniformMatrices(int locIndex, const RLMatrix *mat, int count);
781
783
RLAPI void rlSetUniformSampler (int locIndex , unsigned int textureId ); // Set shader value sampler
782
784
RLAPI void rlSetShader (unsigned int id , int * locs ); // Set shader currently active (id and locations)
783
785
RLAPI unsigned int rlGetShaderCurrent ();
784
-
785
786
// Compute shader management
786
787
RLAPI unsigned int rlLoadComputeShaderProgram (unsigned int shaderId ); // Load compute shader program
787
788
RLAPI void rlComputeShaderDispatch (unsigned int groupX , unsigned int groupY , unsigned int groupZ ); // Dispatch compute shader (equivalent to *draw* for graphics pipeline)
@@ -1489,7 +1490,7 @@ void rlEnd(void)
1489
1490
// NOTE: Depth increment is dependant on rlOrtho(): z-near and z-far values,
1490
1491
// as well as depth buffer bit-depth (16bit or 24bit or 32bit)
1491
1492
// Correct increment formula would be: depthInc = (zfar - znear)/pow(2, bits)
1492
- RLGL .currentBatch -> currentDepth += (1.0f /20000 .0f );
1493
+ RLGL .currentBatch -> currentDepth += (1.0f /200000 .0f );
1493
1494
}
1494
1495
1495
1496
// Define one vertex (position)
@@ -3102,8 +3103,6 @@ void rlDrawRenderBatch(rlRenderBatch *batch)
3102
3103
// Reset vertex counter for next frame
3103
3104
RLGL .State .vertexCounter = 0 ;
3104
3105
3105
- // Reset depth for next draw
3106
- batch -> currentDepth = -1.0f ;
3107
3106
3108
3107
// Restore projection/modelview matrices
3109
3108
RLGL .State .projection = matProjection ;
@@ -3117,9 +3116,6 @@ void rlDrawRenderBatch(rlRenderBatch *batch)
3117
3116
batch -> draws [i ].textureId = RLGL .State .defaultTextureId ;
3118
3117
}
3119
3118
3120
- // Reset active texture units for next batch
3121
- for (int i = 0 ; i < RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS ; i ++ ) RLGL .State .activeTextureId [i ] = 0 ;
3122
-
3123
3119
// Reset draws counter to one draw for the batch
3124
3120
batch -> drawCounter = 1 ;
3125
3121
//------------------------------------------------------------------------------------------------------------
@@ -4401,6 +4397,19 @@ void rlSetUniformSampler(int locIndex, unsigned int textureId)
4401
4397
#endif
4402
4398
}
4403
4399
4400
+
4401
+ // Reset depth for next draw
4402
+ void rlResetDrawDepth ()
4403
+ {
4404
+ RLGL .currentBatch -> currentDepth = -1.0f ;
4405
+ }
4406
+
4407
+ // Reset active texture units for next batch
4408
+ void rlClearActiveTextures ()
4409
+ {
4410
+ for (int i = 0 ; i < RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS ; i ++ ) RLGL .State .activeTextureId [i ] = 0 ;
4411
+ }
4412
+
4404
4413
// Set shader currently active (id and locations)
4405
4414
void rlSetShader (unsigned int id , int * locs )
4406
4415
{
0 commit comments