Hello NVIDIA Developer Community,
I would like to share a real-time dual-GLB combat rendering experiment that I developed for the NVIDIA Jetson Orin Nano Super.
The project renders an animated character model and a separate magic-sword model while generating attack geometry, energy trails, hit reactions and state transitions in real time.
The main objective is to explore a CUDA–OpenGL architecture for interactive 3D effects while keeping most dynamic geometry generation on the GPU.
Video Demonstration
The following video shows the current implementation running with two GLB assets.
The demonstration includes:
- A separate GLB character and magic-sword model
- Repeated sword attack sequences
- GPU-generated blue and purple energy effects
- Dynamic sword movement and attack trajectories
- Character hit highlighting
- Knockback and displacement reactions
- Return-to-idle transitions
- Runtime status information
- Repeated attack-state cycles
The video is intended as a rendering and architecture demonstration rather than a formal performance benchmark.
Rendering Pipeline
The current rendering pipeline is organized approximately as follows:
GLB Asset Loading
→ Character and Sword Transform Updates
→ CUDA Attack-Geometry Generation
→ OpenGL Buffer Update
→ Character and Weapon Rendering
→ Transparent Energy-Effect Rendering
→ Hit-Reaction and State Processing
The character and sword are treated as separate scene objects with independent transforms and effect states.
OpenGL performs the final model and effect rendering, while CUDA is used to calculate or update dynamic attack data.
Dual-GLB Scene Structure
The project loads two independent GLB assets:
- An animated humanoid character
- A magic-sword or weapon model
Each object has its own:
- Model transformation
- Position and orientation
- Animation or idle state
- Material configuration
- Effect attachment points
- Combat-state information
Keeping the weapon separate from the character makes it possible to move, rotate and animate the sword independently during attack sequences.
It also allows the same attack system to be reused with different weapon and character assets.
CUDA-Generated Attack Effects
CUDA is used to update dynamic effect information such as:
- Attack-path positions
- Sword-trail vertices
- Energy-blade geometry
- Particle positions
- Fragment directions
- Effect opacity
- Emissive intensity
- Impact orientation
- Effect lifetime
The resulting data is consumed by OpenGL for final rasterization.
The CPU mainly controls the current attack state and timing. It does not need to calculate every trail vertex or effect particle individually.
Attack and Reaction State Machine
The combat sequence is controlled by a state-based system.
A simplified sequence is:
Idle
→ Attack Preparation
→ Sword Movement
→ Contact or Impact
→ Character Hit Reaction
→ Knockback
→ Recovery
→ Return to Idle
Each state controls different parameters, including:
- Sword position
- Sword rotation
- Attack speed
- Character displacement
- Emissive intensity
- Trail length
- Effect visibility
- Reaction duration
This makes it possible to create repeatable attack sequences while keeping the rendering system separate from the gameplay-state logic.
Hit-Reaction Rendering
When an attack reaches the target, several effects can be activated together:
- Character emissive highlighting
- Screen-facing impact geometry
- Short-duration energy trails
- Character displacement
- Knockback direction
- Temporary material-intensity changes
The reaction effects are synchronized with the attack timeline rather than being rendered continuously.
One area I am currently improving is the transition between the normal character material and the high-intensity hit effect, so that the model remains visible without becoming completely white.
CUDA–OpenGL Interoperability
Dynamic attack geometry is updated frequently, so CUDA–OpenGL synchronization is an important part of this project.
The current workflow conceptually includes:
- Registering an OpenGL buffer for CUDA access
- Mapping the resource
- Updating attack or effect geometry with CUDA
- Unmapping the resource
- Rendering the updated data with OpenGL
I am currently evaluating the overhead of mapping and unmapping resources during every effect frame.
Possible alternatives include:
- Double-buffered effect VBOs
- Persistent OpenGL buffer storage
- Longer-lived mapped resources
- Multiple CUDA streams
- Explicit CUDA and OpenGL synchronization
- Preallocated effect-memory pools
GLB Materials and Lighting
The video currently uses a high-contrast black background so that the energy effects remain clearly visible.
The character, sword and attack effects use separate material paths.
The rendering system can distinguish between:
- Character base material
- Weapon material
- Emissive attack material
- Transparent trail material
- Hit-reaction material
- Screen-facing impact geometry
The current visual style emphasizes blue, cyan and purple emissive effects.
Future improvements may include physically based materials, improved tone mapping and more controlled bloom.
Transparency and Overdraw
Several attack effects use transparent or additive rendering.
When large energy planes and multiple trails overlap, the fragment workload can increase significantly.
The main optimization areas include:
- Reducing oversized transparent geometry
- Limiting unnecessary screen coverage
- Reducing inactive particles
- Culling expired effect segments
- Sorting transparent layers
- Rendering selected effects at reduced resolution
- Avoiding excessive additive blending
- Adjusting effect quality dynamically
Current Development Focus
I am currently working on:
- More stable CUDA–OpenGL synchronization
- Lower dynamic-buffer update overhead
- Improved GLB material rendering
- Better separation between character and effect passes
- More natural hit and knockback transitions
- Reduced transparent overdraw
- More accurate frame-time measurements
- Long-duration runtime stability
- Adaptive effect quality for Jetson
Questions for the Community
I would appreciate feedback on the following points:
-
For attack geometry that changes every frame, is mapping and unmapping a CUDA–OpenGL VBO each frame an appropriate approach on Jetson Orin Nano?
-
Would double-buffered or persistently allocated OpenGL buffers provide a meaningful improvement for this type of dynamic effect workload?
-
What synchronization strategy is recommended when CUDA generates geometry immediately before OpenGL renders it?
-
For large transparent sword trails, what is the most effective way to reduce overdraw on Jetson while preserving the visual shape?
-
Is it preferable to generate all particle and trail vertices with CUDA, or would instanced OpenGL rendering be more efficient for repeated effect elements?
-
Which Nsight Systems measurements are most useful for identifying stalls between CUDA geometry generation and OpenGL rendering?
Thank you for reading.
Any feedback regarding CUDA–OpenGL interoperability, GLB rendering, dynamic geometry generation or Jetson-specific optimization would be greatly appreciated.