A small Direct3D 11 demo that renders a simple "Flappy-bird" game for stereoscopic single-image random dot stereogram (SIRDS) generation. The app renders a left and right depth buffer, converts those into a SIRDS image and displays it. Intended for Windows (desktop) development and experimentation.
- Direct3D 11 rendering of a simple 3D scene
- Simple input to start/play/flap and toggle stereo eye
- Windows 10 (or later)
- Visual Studio 2019 / 2022 (MSVC)
- Windows 10 SDK
- Direct3D 11 runtime (part of Windows)
- Project uses portions of DirectX Tool Kit / DirectXTex (included or bundled in the repo)
- Open the solution in Visual Studio: open the
srcfolder and load the.vcxprojundersrc. - Build via Build → Build Solution.
- Run from Visual Studio (F5) or use Debug → Start Without Debugging.
Debug and runtime output appears in the Visual Studio Output pane and via DebugOut() logging.
src/Game.h/src/Game.cpp— main application, rendering loop, device setup, resize handling.src/FlappyData.h— gameplay state and theViewingParametersclass.src/Source.cpp— SIRDS generator (InitStatics,ZBuffersToDrawer) / CPU drawer.src/3DText.*— font / text rendering helpers.src/*— other helpers and resource files.
All code is under src/.
- Scene is drawn twice (left and right eye) into depth-enabled render targets.
- Depth images are captured/read back to CPU (
CaptureTexture) and provided to theSirdsDrawer. SirdsDrawerruns a CPU stereogram algorithm to produce an RGBA image.- The RGBA image is uploaded to the GPU as a shader resource and drawn as a fullscreen sprite.
ViewingParameters centralizes eye separation, viewing distance, DPI-derived pmm, and near/far values.
- Key press (any assigned key per
WM_KEYDOWN) to start the game and flap.- When not playing, a keypress initiates Play mode.
- When playing, a keypress triggers the flap (see
flapEffectinFlappyData).
- Left mouse button toggles left/right eye.
- Right mouse button sets center-eye view.
Adjust gameplay values in src/FlappyData.h (e.g. gravity, flapEffect, gapHeight).
ViewingParameters (in src/FlappyData.h) contains:
viewDistance— viewing distance used by the SIRDS algorithmoffsetDistance— offset distance used for depth compositioneyeSeparation— inter-eye separation in mmpmm— pixels-per-millimeter (set inGame::InitGame())zNear,zFar— computed per-frame viewing frustum near/faroffset— additional offset tuning
Use flappyData.view.<member> in code or edit defaults for different behavior.
- Enable the D3D debug layer for better diagnostics (already conditionally enabled under
_DEBUG). - Use Visual Studio Graphics Diagnostics to inspect textures, render targets and shader resources.
- Name resources using
SetPrivateDatawhen developing to make frame capture inspection easier.
- Fork the repo, create feature branches, open PRs against
main. - Keep changes scoped per PR and include a brief explanation + perf/regression notes.
- Mention platform or SDK assumptions for any environment-specific changes.