Upgrade Raylib to 6.0 (#337)
* Updated target to Raylib 6 + synced invoke called with the changes in C. [WARNING: Breaking changes!] * Added severial examples. Corrected towards the correct return type and add utilities to prevent working with pointers * Additional resources from the Raylib repo. * Fixed additional pinvokes to match with the new raylib bindings. [Warning breaking changes!] * Fixing the QOL utils * Fixing the Mesh struct * Applying changes after review. Merged resources.LICENSE + raylib-cs.Native.csproj only targets dotnet8 * Updated README to reflect .NET 10 and Raylib 6 compatibility changes. * Updated shader colors, adjusted car model scale, disabled HDR in SkyboxDemo, and fixed camera mode assignment. Removed unused `Capacity` field in FilePathList struct. * Improved XML comments for consistency, fixed spacing and formatting across examples, added new resources to `resources.LICENSE`. * Updated XML comment for `GetDirectoryFileCountEx` to clarify behavior and filtering options. * Updated and clarified XML comments for methods and parameters, improved naming consistency, and refined shader-related functions. Renamed enums in `Shader.cs` for so it is inline with the upstream. * Improved XML comments for clarity and consistency in `Model.cs` and `Mesh.cs`, updated method and variable names for better readability, and adjusted logic in span creation methods. * Corrected XML comment capitalization in `Model.cs`. --------- Co-authored-by: Meatcorps <info@meatcorps.nl>
This commit is contained in:
parent
1b890169c5
commit
21d83c60a9
189 changed files with 43644 additions and 380 deletions
58
Examples/resources/shaders/glsl120/cubes_panning.fs
Normal file
58
Examples/resources/shaders/glsl120/cubes_panning.fs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#version 120
|
||||
|
||||
// Input vertex attributes (from vertex shader)
|
||||
varying vec2 fragTexCoord;
|
||||
varying vec4 fragColor;
|
||||
|
||||
// Custom variables
|
||||
const float PI = 3.14159265358979323846;
|
||||
uniform float uTime;
|
||||
|
||||
float divisions = 5.0;
|
||||
float angle = 0.0;
|
||||
|
||||
vec2 VectorRotateTime(vec2 v, float speed)
|
||||
{
|
||||
float time = uTime*speed;
|
||||
float localTime = fract(time); // The time domain this works on is 1 sec
|
||||
|
||||
if ((localTime >= 0.0) && (localTime < 0.25)) angle = 0.0;
|
||||
else if ((localTime >= 0.25) && (localTime < 0.50)) angle = PI/4.0*sin(2.0*PI*localTime - PI/2.0);
|
||||
else if ((localTime >= 0.50) && (localTime < 0.75)) angle = PI*0.25;
|
||||
else if ((localTime >= 0.75) && (localTime < 1.00)) angle = PI/4.0*sin(2.0*PI*localTime);
|
||||
|
||||
// Rotate vector by angle
|
||||
v -= 0.5;
|
||||
v = mat2(cos(angle), -sin(angle), sin(angle), cos(angle))*v;
|
||||
v += 0.5;
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
float Rectangle(in vec2 st, in float size, in float fill)
|
||||
{
|
||||
float roundSize = 0.5 - size/2.0;
|
||||
float left = step(roundSize, st.x);
|
||||
float top = step(roundSize, st.y);
|
||||
float bottom = step(roundSize, 1.0 - st.y);
|
||||
float right = step(roundSize, 1.0 - st.x);
|
||||
|
||||
return (left*bottom*right*top)*fill;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 fragPos = fragTexCoord;
|
||||
fragPos.xy += uTime/9.0;
|
||||
|
||||
fragPos *= divisions;
|
||||
vec2 ipos = floor(fragPos); // Get the integer coords
|
||||
vec2 fpos = fract(fragPos); // Get the fractional coords
|
||||
|
||||
fpos = VectorRotateTime(fpos, 0.2);
|
||||
|
||||
float alpha = Rectangle(fpos, 0.216, 1.0);
|
||||
vec3 color = vec3(0.3, 0.3, 0.3);
|
||||
|
||||
gl_FragColor = vec4(color, alpha);
|
||||
}
|
||||
Loading…
Reference in a new issue