Changelist v1.5.0.3914

✨ New Features

Platforms

  • WinARM64EC platform support added
  • New Linux compiler verification

Texturing

  • Texture compression: global setting by "GorillaTextureCompression := tcFast;" with 3 modes tcNone|tcFast|tcQuality Reducing memory usage in the GPU RAM up to 6:1. You need to call that before "Application.Initialize;" and need to include "Gorilla.Context.Types" in uses.
  • Fixed anisotropic texturing filtering, by using the global setting "GorillaDefaultMaxAnisotropy := 16;" and "TGorillaTextureBitmap(LTex).MaxAnisotropy := GORILLA_ANISOTROPY_DEFAULT;" specific texture setting.

Camera

  • New orthographic and isometric projection settings

Animation

  • Put the play head at ATime WITHOUT computing a pose by the SeekTo method
  • TGorillaRenderClock.Tick() introduced to control animation update independently

Audio

  • TTS (Text To Speech) Engine, using Piper, added for Windows, Android, Linux and OSX platforms
  • STT (Speech To Text) Engine, using Whisper, added
  • FMOD and OpenAL with recording sound support

Network

  • Arena multiplayer framework added using Tethering and gaming server connection support

GPU & Backend

  • New function in Gorilla.Context.Backend to force setting high performance GPU (NVIDIA / AMD)
  • New function in Gorilla.Context.Backend to check for hybrid-copy-back state, when display GPU and rendering GPU differs This leads to much less performance and can now be detected and shown to users by message or exception.

Templates

  • Thanks to peardox, we have started to provide project templates as starting point

🐞 Bug Fixes & Stability

Optimization

  • ObjectAtPoint/Picking performance issues fixed - FPS dropped massively even on HitTest=false
  • RecalcAbsolute() fixed of TControl3D in Gorilla objects - deep loop iterations dropped framerate massively
  • TGorillaRedundancyCheck type introduced to detect reapplying the same material

Mesh & Instancing

  • BeginInstancesEditing / EndInstancesEditing and BeginUpdate / EndUpdate methods for multiple edits on TGorillaMeshInstance failed or leading to unexpected results
  • RingBuffer introduced for faster copy-process and less allocation (+4.3% at 2690 draws)
  • Model/mesh duplication failed on different positions, due to optimization in RecalcAbsolute routine

Formats

  • glTF/GLB: Import of Quaternius models failed due to unsupported MIME type in buffer data loading
  • DAE: WEAKPACKAGEUNIT flag added to reduce the number of exported types - crashing the 12.3 compiler
  • FBX: shutdown exceptions on animated fbx models - dead references throwing access violations

Animation

  • InPlace extended by a SetInPlace method to re-bake cached animation
  • Animation frame detection more closely to the current frame
  • Skipping armature computation if called multiple times per frame

Materials & Shaders

  • "_ModelViewProjectionMatrix" was removed from the ShaderData in DefaultMaterials, because it's not correct when using instances use instead: "_ProjectionMatrix _ViewMatrix a_ModelMatrix" in your shaders
  • per-draw shader program handling (+19% at 2690 draws)
    • "ActivateDefault" removed after each shader execution
    • "FindProgram" call optimized
  • CSM rendering optimized to reduced the number of rendered objects
  • WBOIT transparency sorting adopted by screensize
  • InitializeTexture / FinalizeTexture crashed in a few demos due to unlucky setup

Q3 Physics

  • Ratio treatment in Q3-Body fixed - led to incorrect behaviour

Android

  • EGL 3 context on android introduced

Changelist v1.5.1.3925

✨ New Features

  • glTF/GLB animation names loaded
  • glTF/GLB loading animations from separated file tested with kitKay by Quaternius
  • TGorillaSystem introduced + new methods for retrieving display information: GetDisplays, GetPrimaryDisplay, GetDisplayDiagnosticsReport
  • Arena framework refactored and expanded for linux support

🐞 Bug Fixes & Stability

  • TGorillaLayer3D throws an exception when users put it onto a form or in another FMX component (not the viewport)
  • Template demos added large ram usage on win32 applications > 4k resolution led to 1285 memory exceeded exceptions
  • Arena linux connection issues fixed, game server locating fixed
  • Arena game server now supports multiple local ip's on a single public ip for better connectablitity
  • Viewport design time property modification getting lost at runtime
  • Skybox design time property modification getting lost at runtime
  • Skybox design time bright-blue bar in the middle removed (incorrect fmx resizing control)
  • Gizmo tool lighting removed for coloring even without light source in the scene
  • Various MACOS issues fixed
    • POM material rendering fixed
    • PBR material rendering fixed
    • Emissive Blur rendering fixed
    • FXAA render pass rendering fixed
    • PostFX render pass rendering fixed
    • GLSL to MSL converter fixes
  • Massive improvement of skeleton joint modification!
  • Skia support enhanced - massive performance issues reduced by Gorilla3D specific solutions
  • Invalidate for TGorillaSmoothCameraController removed


Changelist v1.5.2.3964

✨ New Features

Viewport

  • New frame timing properties DeltaTime, CurrentFrameTime and PreviousFrameTime (seconds, wall clock, per really rendered frame)
  • New events OnBeforeRender / OnAfterRender (ASender; const ADeltaTime: Double) - called once per rendered frame, the place for per-frame game logic instead of OnPaint or a timer
  • New property FramesPerSecond: the frame rate that really reaches the screen (Diagnostics.AverageFramesPerSecond remains the headroom value)
  • Diagnostics are now measured independently of the overlay: DiagnosticsActive only switches the display. FramesPerSecond was always 0 without UseFixedFrameRate before - fixed
  • New property DiagnosticsMeasuring (default True) to switch the measuring off for more performance. DeltaTime and the frame events are not affected

Modular Characters (glTF)

  • New TGorillaModel.AddSkinnedMeshFromFile / AddSkinnedMeshFromStream / AddSkinnedMeshFromDef: attach skinned meshes of a further file (clothes, armor, hair - e.g. Quaternius "Universal Base Characters" + "Modular Outfits") to the armature of an already loaded model
    • Joints are matched by name, the file's own skeleton is ignored. Missing joints raise an exception listing them
    • Attached meshes follow every animation of the model, including animations added later
    • RemoveSkinnedMesh / ClearSkinnedMeshes / GetSkinnedMeshCount / GetSkinnedMesh
    • The body definition is not modified, so definitions shared by an assets package stay intact
    • Works with cached animations (attached meshes are skinned on the CPU)
    • Runtime only: attached meshes are not stored with the model and not duplicated
  • New TGorillaSkinnedMeshOptions.HideCoveredSurfaces: hides the body triangles beneath an outfit (no skin poking through clothes, no z-fighting). CoverDistance (default 0.08) and KeepJoints (e.g. ['Head'] for helmets with a visor slit) for fine tuning. Removing an outfit restores the body exactly
  • Animations loaded from separate files (AddAnimationFromFile) are now retargeted onto the rest pose of the target skeleton - animation libraries with other bone lengths (e.g. Quaternius UAL) no longer squash or stretch the character
  • New TSkinDef.RelinkJoints(TArmatureDef) to rebind a skin to the joints of another armature
LModel := TGorillaModel.LoadNewModelFromFile(GorillaViewport1, nil,
  'Regular_Male_FullBody.gltf', GORILLA_ANIMATION_CACHING_DEFAULT);
LModel.Parent := GorillaViewport1;
LModel.AddAnimationFromFile('Animations\UAL1.glb', GORILLA_ANIMATION_CACHING_DEFAULT);
LModel.AnimationManager.PlayAnimation('Walk_Loop');

// put on an outfit and hide the body beneath it
LOutfit := LModel.AddSkinnedMeshFromFile('Clothes\Male_Ranger.gltf',
  TGorillaSkinnedMeshOptions.Create(true));
// ... take it off again
LModel.RemoveSkinnedMesh(LOutfit);

Bounding Box

  • New ShowBoundingBox / BoundingBoxColor (published) on every Gorilla3D control (TGorillaControl): draws a box around the CURRENT pose, following skin, vertex and sub-mesh animations
  • New GetAnimatedBoundingBox(): bounds of the current pose in model space
  • Cached animation frames store their bounding box (TMeshBufferObject.BoundingBox / HasBoundingBox) without any per-frame cost
  • New helper Gorilla.DefTypes.GetVertexBufferBoundingBox()

Animation

  • New TGorillaAnimationManager.GetAnimationNames() and GetSortedAnimations() with natural sorting ("Walk10" comes after "Walk2")
  • GetFirstAnimation, GetLastAnimation, PlayNextAnimation and PlayPreviousAnimation now follow the sorted animation names instead of hash values
  • GetAnimation / PlayAnimation fall back to the component name (case-insensitive) if no animation has the given id ("archer-idle.dae" is named "archer_idle_dae")

Metal (macOS / iOS) - in development

  • Cascaded Shadow Maps (CSM) running on Metal (2D array textures, sampler2DArray, AttachTextureLayer)
  • 3D textures implemented (UpdateBuffer, Update3DSlice, GenerateMipMap)
  • GLSL-to-MSL converter extended: texture2D/textureCube/...Lod/Proj aliases, precision statements, generic swizzles incl. ivec/uvec, usampler types, gl_FrontFacing, several parser fixes
  • Face render pass ported to Metal
  • Diagnostics: GLSL of a failed conversion or MSL compilation is written to the user's home folder, the path is part of the exception message

Vulkan - in development

  • Cascaded Shadow Maps (CSM) support
  • Dynamic instance ring buffer, increased uniform buffer size
  • Opt-in strict face culling for material pipelines (TGorillaContext.SetStrictFaceCulling)

Optimization

  • Material property changes no longer re-upload all GPU textures. New TGorillaTextureBitmap.UnsetTextureReferenceIfChanged() releases a texture only if the bitmap really changed. Attaching a Quaternius outfit went down from ~19.7 s to ~3.3 s (Debug build)
  • TGorillaTerrainMaterialSource keeps the GPU textures of unchanged terrain normal maps

IDE

  • Audio components moved to a separate IDE tool palette section
  • Designtime re-rendering cycle reduced to 50 ms (before 200 ms)

Formats

  • g3d format increased to v6 (per-mesh joint weights for multi-primitive skins)

🐞 Bug Fixes & Stability

Rendering

  • Z-fighting after changing near/far plane at runtime - the projection matrix was only updated on resize
  • PBR normal inversion incorrect: 'if (dot(N, V) < 0.0) N = -N;' replaced by 'if (!gl_FrontFacing) N = -N;'
  • Terrain tangent computation not correct
  • Large models blocked the IDE at designtime due to non-static rendering, pushing vertices to the GPU over and over again
  • TGorillaModel.GetAbsoluteBoundingBox() fixed
  • GorillaPhysicsSystem no longer clickable at designtime (it was overlapping all other components)

Animation & Skinning

  • Skinned glTF models loaded at designtime animated only partially at runtime (e.g. BlueSoldier_Female: only the hair moved). Models embedded with an older version must be reloaded at designtime
  • "failed to draw buffer - buffer object empty" with animation caching on multi-primitive glTF meshes
  • Multi-primitive meshes in a skin were not resolved into their primitives - those primitives were not skinned at all
  • Animation caching fixed for FBX models with meshes beneath joints (e.g. BirdOrange.fbx): missing cached frames, destroyed normals/texcoords ("shredded" texture look), bind pose drawn instead of the animation, empty bounding box
  • Animation caching fixed for vertex groups (e.g. Agreus.fbx): "failed to bind indices - static buffer not assigned"
  • Cached animations from meshy.ai starting at key #1 instead of #0 - FindKeysClamped introduced

Formats

  • glTF: COLOR_n as normalized VEC3/VEC4 unsigned byte/short caused a heap overflow (access violation / deadlock while loading Blender and Quaternius exports); vertex colors also lost their alpha
  • FBX: textures referenced with an absolute path of another machine and another file format (e.g. "C:\Temp...\X.tga" vs. "textures\X.png") were not found. Embedded textures that can not be decoded are now logged and skipped instead of aborting the whole import

Metal (macOS)

  • Red/blue color swap with GlobalUseSkia (bitmap textures now follow the source byte order RGBA/BGRA)
  • Rendering into CSM atlas slices froze the whole Mac
  • Access violation in replaceRegion on mismatching pixel formats (RGB32F render targets)
  • Crash when focusing a TEdit (FMX texture_flip / gouraud_flip shaders are GLSL-only, Metal sources are now provided)
  • Missing uniform blocks (e.g. uShadowBlock before the CSM pass exists) bound with a zero-filled buffer
  • Volumetric mesh front/back face lookup flipped vertically on Metal and Vulkan
  • Tumble&Roll game demo now running on macOS

Vulkan

  • Crash on fast buffer changes due to released references (very reproducible in combination with CSM) - resources are now destroyed deferred
  • CSM render pass exceptions: a cached render pass referenced a released context after an atlas resize, the scene could render "in shadow" for the whole session
  • VK_ERROR_DEVICE_LOST (magenta viewport) in volume rendering due to mismatching buffer/image copies; 3D texture upload transitioned 0 mip levels
  • Translucent-only scenes never cleared the default frame buffer; dirty translucent render buffers are now cleared
  • Translucent rendering defect when switching blending on/off
  • Water rendering with a flipped normal
  • Environment render pass led to a gray background
  • Startup exception on cube maps without array-wide buffer
  • Safe guard for late-binding of the emissive blur render pass

Linux

  • GL error 1280 exception in the multi-platform demo fixed

Changelist v1.5.3.3984

✨ New Features

Viewport

  • Transparent viewport background: setting TGorillaViewport.Color to a value with alpha < 255 (e.g. TAlphaColorRec.Null) lets components behind the viewport shine through, only the rendered 3D content covers them. The deferred composite pass no longer forces alpha to 1.0

Camera

  • New property ShiftOnGround: shifting (left/right, forward/backward) stays on the ground plane instead of following the camera's pitch
  • Tilting in orbit mode is now limited by LimitUpAndDownMin / LimitUpAndDownMax

Animation

  • New TGorillaModel.ResetToBindPose() to reset the model to its static pose without animations (cached and CPU skinning alike)
  • New TGorillaModel.RecacheAnimations() + RecacheAnimationsByName() to re-bake all or selected animations
  • New TGorillaModel.DiscardAnimationCache() + DiscardAnimationCacheByName() to drop cached frames - the animations fall back to CPU skinning
  • New TGorillaModel.HasCurrentAnimation(), TryGetCurrentAnimation(), IsAnimationPlaying() and IsAnimationPlaying(AId) to query the animation state
if GorillaModel1.IsAnimationPlaying('walk') then
  GorillaModel1.ResetToBindPose();

// re-bake only selected animations, drop the cache of others
GorillaModel1.RecacheAnimationsByName(['walk', 'run']);
GorillaModel1.DiscardAnimationCacheByName(['idle']);

Optimization

  • Instance cache is only submitted to the GPU if instances were touched
  • Rendering updates of the viewport at designtime increased

Documentation


🐞 Bug Fixes & Stability

Rendering

  • Instanced shadow rendering (CSM) did not work
  • Meshes with vertex groups could not be static
  • Underwater and PostFX animations stuttered on OpenGL and Vulkan: the shader time was the absolute system timestamp in single precision (resolving only 1/128..1/16 s). Time is now relative to the start, ResetTime really restarts the stopwatch and W holds the delta time

Animation

  • Animation caching with AllAttributes / Compressed produced no frames - the model stood still (only VertexPosition worked). OpenGL, Metal and Vulkan now draw uncached AllAttributes frames from their own buffer instead of the bind pose
  • Animations without cache (after DiscardAnimationCache or added uncached to a cached model) were drawn in bind pose - the static buffer was rendered instead of the CPU skinned mesh data

Formats

  • glTF: import failed on Substance textures with a defect JPEG EXIF header (new StripJPEGMetadata fallback in the assets manager)
  • glTF: import failed when converting large integers to Int64
  • glTF: multiple nodes referencing the same glTF mesh (e.g. KitBash models) were not handled - mesh ids are now reference checked
  • glTF: large GLB files (3 GB) used enormous amounts of memory (17 GB) because they were not streamed
  • Gorilla.AssetsManager unit was not compilable anymore

OpenGL

  • Viewports without a form in their owner chain (owner nil) left every 3D view blank: no window handle was found, and the half-built shared context broke all following viewports (access violation at address 0). AutoDetectWindowHandle now falls back to Application.MainForm or the first form in Screen.Forms with a handle; a failed shared context is removed so the next attempt starts over

Metal (macOS)

  • SkyBox cube map showed swapped red/blue channels with GlobalUseSkia enabled (Skia bitmaps are BGRA, the cube map is RGBA). Each cube map face is now checked and swapped if necessary

Vulkan

  • Incorrect delayed unloading of CSM resources led to memory leaks and long clearing times
  • Logs a one-time warning if Compressed animation caching is used (not supported, the bind pose is shown)
  • FBO render pass was not rebuilt when an attachment format changed (e.g. 8 bit -> RGBA16F), leading to VUID-VkFramebufferCreateInfo-pAttachments-00880
  • Image layout validation errors when sampling render targets (VUID 00900, 00344/08114, 01197): sampled attachments now stay in SHADER_READ_ONLY_OPTIMAL via a cached feedback render pass variant
  • Performance drop when sampling render targets (e.g. CSM atlas): layouts were switched back and forth around every lit draw (46 -> 12 fps in a test scene). Render target layouts are now tracked and only transitioned when really needed
  • Multiple TGorillaVolumetricMesh instances: only the last drawn volume was visible, because restarting the translucent render pass mid-frame cleared previous translucent draws

Changelist v1.5.4.4003

✨ New Features

Viewport: Render Resolution

  • The scene can now be rendered in a resolution different from the viewport. The image is scaled onto the viewport afterwards, the screen resolution of the monitor is not touched (Core/Viewport - Render Resolution and Scaling)
  • New property RenderScale (0.1 .. 4, default 1): uniform factor on the native resolution. Values below 1 render faster, values above 1 render supersampled
  • New properties RenderWidth / RenderHeight: fixed render resolution in pixels (e.g. 1280 x 720), which has priority over RenderScale. 0 x 0 = native resolution (default)
  • New SetRenderSize(W, H) / SetRenderSize(TPoint) and public property RenderSize to set both values with a single rebuild of the render targets
  • New property RenderFit: rfLetterbox (default, keeps the aspect ratio, black borders) or rfStretch for a fixed resolution with a different aspect ratio
  • New property RenderFilter: rflLinear (default) or rflNearest (blocky pixel-art look) for the upscaling. Nearest is honored by Direct2D and Skia canvases, the FMX GPU canvas always scales linear
  • New methods GetRenderTargetSize, GetRenderDisplayRect, GetRenderAspectRatio, IsRenderScaled, HasFixedRenderResolution, ViewToRenderPoint / RenderToViewPoint
  • Picking (Gorilla and FMX objects), ScreenToWorld, WorldToScreen and MakeScreenshot respect the render resolution, including letterbox offset and stretching
  • Render passes without an individual size (OverwriteViewportSize = False) follow the render resolution of the viewport automatically (new TGorillaRenderPassController.GetRenderTargetSize)
// performance mode: a quarter of the pixels
GorillaViewport1.RenderScale := 0.5;

// fixed game resolution, letterboxed
GorillaViewport1.SetRenderSize(1280, 720);
GorillaViewport1.RenderFit := TGorillaRenderFit.rfLetterbox;

// back to the native resolution
GorillaViewport1.SetRenderSize(0, 0);

Vulkan & Metal

  • Environment mapping and IBL (image based lighting) rendering supported on Vulkan and Metal

Demos

  • Multi-platform demo now runs on Android (tested with BlueStacks)
  • MACOS demo: Mage.glb model added for testing the Linux support

Documentation

  • Viewport, Renderer and Render Pass Controller documentation updated for the render resolution settings

🐞 Bug Fixes & Stability

Viewport & Render Passes

  • HighRes on displays with a scaling above 100 %: full screen render passes (PostFX, composite, SSAO, ...) zoomed into the top left corner of their image. Render textures no longer get an FMX texture scale > 1, HighRes uses the new render resolution mapping instead
  • TGorillaRenderPassController.ComputeRenderingSize multiplied the (already pixel based) size with the texture scale a second time - passes rendered beyond or only into a part of their texture with HighRes
  • MakeScreenshot copied only a part of the image with HighRes
  • TGorillaViewport.WorldToScreen raised an access violation while the design camera was in use
  • TGorillaSmoothCameraController.AdjustCameraToTarget now uses the aspect ratio of the rendered image
  • Android / Linux: fixed frame rate rendering (UseFixedFrameRate) was silently ignored, both platforms always rendered event based. It now works and is the default there as well: the timer paces the rendering, the frames are rendered inside the FMX paint cycle. iOS remains event based only
  • Vertex counting in the diagnostics fixed

Rendering

  • Cascaded shadow maps with adaptive range - before only the first 50 m were valid
  • Render pass ignore list (IsControlIgnored) now also checks the parent chain: models loaded after Target / IgnoredControls were streamed from the form file were rendered into their own environment cube map (flat, bright reflection)
  • Render pass controller: IsControlIgnored pulled down performance massively
  • Environment lookup uses the direction only (environment at infinity), refraction uses the incident view direction. Lambert / Phong / Blinn reflections sampled the opposite direction
  • OpenGL (Windows / Linux): cube map seams on rough PBR surfaces (GL_TEXTURE_CUBE_MAP_SEAMLESS enabled)
  • Vertex color attribute was not applied to the data and PBR materials

Animation & glTF

  • Non-skinned meshes below a joint (eyes, weapons, horns, ...) did not follow the animation - they are now rigidly attached to their joint
  • Clips without a track for a node animated by other clips of the same file kept the pose of the previously played clip (e.g. a hidden weapon stayed hidden). Such nodes now get a constant track with their rest pose, also for animations loaded from separate files
  • Single-key clips (static poses like "T-Pose" or "Death_B_Pose") were never applied
  • Zero-length clips stopped a crossfade at its first tick, the model kept the old pose
  • With animation caching, pose clips without baked frames were drawn in bind pose - they are now skinned on the CPU

Particles

  • Async particle emitter blocked the rendering due to a monitor lock
  • Particles did not work and the async computation crashed on Vulkan

Audio

  • TGorillaFMODSound.Destroy did not free its handle
  • Loading empty.mp3 sometimes failed right after installation - the exception is ignored now

Vulkan

  • Linux: resizing the window crashed with "Runtime error 232". A destroyed context freed buffers, memory and descriptor pools still in use by the GPU, the context destructor now waits for the graphics queue
  • Sampler arrays (texture pools with DeclareAsArray: terrain, grass, splat map) got a single descriptor, so the terrain was almost black. They are now split into single samplers on consecutive bindings (removes VUID-08114 and VUID-07991)
  • The lock GLiveVulkanContextsLock showed up in memory leak reports (FastMM4/5, ReportMemoryLeaksOnShutdown) - it is never freed by design and is now registered as expected leak

Installation

  • LICENCE.txt encoding changed to be compatible with GetIt