package sun import rl "vendor:raylib" import r3d "../r3d" X_INSTANCES :: 50 Y_INSTANCES :: 50 INSTANCE_COUNT :: X_INSTANCES * Y_INSTANCES main :: proc() { // Initialize window rl.InitWindow(800, 450, "[r3d] - Sun example") defer rl.CloseWindow() rl.SetTargetFPS(60) // Initialize R3D r3d.Init(rl.GetScreenWidth(), rl.GetScreenHeight()) defer r3d.Close() r3d.SetAntiAliasing(.FXAA) // Create meshes and material plane := r3d.GenMeshPlane(1000, 1000, 1, 1) defer r3d.UnloadMesh(plane) sphere := r3d.GenMeshSphere(0.35, 16, 32) defer r3d.UnloadMesh(sphere) material := r3d.GetDefaultMaterial() defer r3d.UnloadMaterial(material) // Create transforms for instanced spheres instances := r3d.LoadInstanceBuffer(INSTANCE_COUNT, {.POSITION}) defer r3d.UnloadInstanceBuffer(instances) positions := cast([^]rl.Vector3)r3d.MapInstances(instances, {.POSITION}) spacing: f32 = 1.5 offsetX := (X_INSTANCES * spacing) / 2.0 offsetZ := (Y_INSTANCES * spacing) / 2.0 idx := 0 for x in 0..