SkillAgentSearch skills...

Plush

A neat, portable, realtime 3D rendering library.

Install / Use

/learn @erysdren/Plush
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Plush 3D v1.2.0

| | | |------------------------------------------------|---------------------------------------------------| | | | | | |

A neat, portable, realtime 3D rendering library originally created between 1996 and 2000 by Justin Frankel and Nullsoft, Inc.

This version has been updated with some minor modernization tweaks, including the use of stdint.h and packaging through CMake and pkg-config. The original examples have also been ported to SDL2 and SDL3.

Original homepage: 1014.org

Archived homepage: nullsoft.com

Archived versions: archive

Notes

| File | Author | Source | |---|---|---| | brick.pcx | necrolavigne | | | steel2.pcx | Valve Software | Half-Life Alpha | | measure.pcx | Valve Software | Half-Life Alpha | | concrt1d.pcx | Valve Software | Half-Life Alpha | | concrt1c.pcx | Valve Software | Half-Life Alpha | | concrt1b.pcx | Valve Software | Half-Life Alpha | | concrt1.pcx | Valve Software | Half-Life Alpha | | cncrt2.pcx | Valve Software | Half-Life Alpha | | +0~fifties_lgt2.pcx | Valve Software | Half-Life Alpha | | -3lcon0.pcx | Valve Software | Half-Life Alpha | | -0lcon0.pcx | Valve Software | Half-Life Alpha | | eye.pcx | Valve Software | Half-Life Alpha | | ears.pcx | Valve Software | Half-Life Alpha | | droid_legmap.pcx | Valve Software | Half-Life Alpha | | chrome_steel1.pcx | Valve Software | Half-Life Alpha | | chrome_grayr.pcx | Valve Software | Half-Life Alpha | | black.pcx | Valve Software | Half-Life Alpha | | polyrobo.blend | Valve Software | Half-Life Alpha | | polyrobo.mtl | Valve Software | Half-Life Alpha | | polyrobo.obj | Valve Software | Half-Life Alpha | | skull.obj | Valve Software | Half-Life | | skull.pcx | Valve Software | Half-Life | | texture2.pcx | Valve Software | Half-Life | | polyrobo.bsp | erysdren | | | citybbk.mtl | Future Crew | Second Reality | | citybbk.obj | Future Crew | Second Reality | | ship.blend | Future Crew | Second Reality | | ship.mtl | Future Crew | Second Reality | | ship.obj | Future Crew | Second Reality | | duckdemo.3ds | Justin Frankel | duckdemo.zip | | eggbug.3ds | Xenon Fossil | low poly eggbug | | eggbug.pcx | Xenon Fossil | low poly eggbug | | fork.3ds | Argonaut Technologies Ltd. | BRender Evaluation Kit 1.2 | | earth.pcx | Argonaut Technologies Ltd. | BRender Evaluation Kit 1.2 | | moon.pcx | Argonaut Technologies Ltd. | BRender Evaluation Kit 1.2 | | ground.pcx | Justin Frankel | fly30src.zip | | sky.pcx | Justin Frankel | fly30src.zip | | sky2.pcx | Justin Frankel | fly30src.zip | | texture1.pcx | Justin Frankel | ex01.zip | | logo.obj | erysdren | | | logo.pcx | erysdren | | | scene.blend | erysdren | | | scene320.col | erysdren | | | scene320.dph | erysdren | | | scene320.exr | erysdren | | | scene320.pal | erysdren | | | scene320.png | erysdren | | | scene640.col | erysdren | | | scene640.dph | erysdren | | | scene640.exr | erysdren | | | scene640.pal | erysdren | | | scene640.png | erysdren | | | susan.blend | erysdren | | | susan.obj | erysdren | | | teapot.obj | Martin Newell | The University of Utah | | text01.pcx | erysdren | | | text02.pcx | erysdren | | | text03.pcx | erysdren | | | text04.pcx | erysdren | |

Features

  • Rasterization:
    • 8bpp only
    • Z-buffer or painters algorithm
    • Solid, Environment, Textured, Perspective Textured, Perspective Environment, Textured Environment, Translucent fills
    • None, Flat, Gouraud, Distance lightshading
  • Unlimited number of cameras
    • Pitch, Pan, and Roll control
    • Target tracking
  • Unlimited number of point and directional lights, each with own intensity
    • Point lights with distance falloff
  • Hierarchical Objects
    • .3DS Mesh Reader
    • .COB Mesh Reader
    • .JAW Mesh Reader
    • .OBJ Mesh Reader (using fast_obj)
  • Textures
    • PCX texture reader with palette optimization and auto-rescaling
    • Perspective Correct modes have piecewise linear approximation every n pixels.
  • Spline interpolation with tension, continuity, and bias control
  • 4x4 Matrix manipulation library
  • Easy to use, cross-platform API
  • Architecture that makes it simple to add new rasterizers

TODO

  • Re-work .3DS file loader to match the OBJ file loader in terms of syntax
  • Add .BMP file loader
  • Add .LBM file loader
  • Run clang-format on all source files
  • Vertex colours
  • Coloured lights
  • Write usage docs
  • Unify all examples to use main loop callbacks for better Emscripten support
  • Blend mode for textured triangles
  • GLTF loader
  • Palette color cycling features
  • "Shader" structure for rendering triangles with multiple passes
  • Make the whole library thread safe
  • Allow multiple cameras to use the same framebuffer with different "viewports"
  • Allow rendering with triangle strips and triangle fans

CMake Configuration Variables

  • PLUSH_BUILD_EXAMPLES: Set to OFF to disable building the example applications
  • PLUSH_USE_ASAN: Set to ON to enable Address Sanitizer on the library and examples
  • PLUSH_MAX_LIGHTS: Set to any numberic value defining how many lights can be added to a scene. This value is accessible in code with the PL_MAX_LIGHTS preprocessor macro. Default: 32
  • PLUSH_MAX_TRIANGLES: Set to any numberic value defining how many triangles can be rendered in a scene. This value is accessible in code with the PL_MAX_TRIANGLES preprocessor macro. Default: 16384

Example Programs

  • duckdemo.c - .3DS model loading demo
  • eggbug.c - the last migration of the eggbugs
  • ex1.c - the most basic example: an untextured white cube in a black void
  • ex2.c - an untextured purple cube
  • ex3.c - a purple cube and a green torus
  • ex4.c - a texture mapped cube
  • fire.c - procedurally animated fire texture and a skull
  • flurry.c - transparent material showcase
  • fly.c - interactive flight environment
  • metrics.c - portable performance metrics
  • model.c - another .3DS model loading demo
  • polyrobo.c - high polycount robot model
  • polyrobo2.c - high polycount robot model in a large lit scene
  • q3bsp.c - quake 3 bsp loader and renderer
  • reflection.c - real time reflections the old fashioned way
  • scene.c - pre-rendered background and depth buffer example
  • ship.c - a small spaceship tumbling through a sci-fi city's airspace
  • sprite.c - a transparent plane that always faces the camera (like a sprite)
  • teapot.c - obligatory utah teapot
  • texenv.c - environment mapping example
  • texture.c - static texture buffer loading example
  • triangle.c - a single triangle with gouraud shading and pre-lit vertex intensity

Portability

Plush is designed to be highly portable. It has been tested to work with the following compilers:

  • gcc 14.2.1
  • g++ 14.2.1
  • Clang 18.1.8
  • TinyCC 0.9.28rc
  • cproc #f66a6613
  • Open Watcom 1.9
  • MSVC 19.44.35207.1
  • DJGPP 12.2.0

License

Copyright (C) 1996-2000, Justin Frankel and Nullsoft, Inc.
Copyright (C) 2024-2025, erysdren (it/its)

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to a

Related Skills

View on GitHub
GitHub Stars39
CategoryDevelopment
Updated10h ago
Forks4

Languages

C

Security Score

80/100

Audited on Apr 7, 2026

No findings