Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ plush Public

A neat, portable, realtime 3D rendering library.

License

erysdren/plush

Repository files navigation

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

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
  • 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

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 alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

Justin Frankel [email protected]

About

A neat, portable, realtime 3D rendering library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •