Coder Social home page Coder Social logo

middlefeng / nuomodelviewer Goto Github PK

View Code? Open in Web Editor NEW
296.0 25.0 39.0 23.05 MB

A simple Wavefront OBJ viewer.

Home Page: http://nuo.graphics

License: BSD 3-Clause "New" or "Revised" License

Objective-C 3.90% Objective-C++ 12.05% Metal 3.70% C++ 61.56% C 18.58% CMake 0.04% Makefile 0.18%
graphics renderer rendering-engine rendering-3d-graphics wavefront-obj raytracer

nuomodelviewer's Introduction

Nuo Model Viewer

This project consists of:

  • A Wavefront OBJ viewer, supporting both real-time rendering and ray-tracing, which is based on Viewer Foundation, a reusable framework.
  • Viewer Foundation, a reusable framework consisting of:
    • Viewer Foundation Render, which is an encapsulation to the Metal APIs, providing simplified resource and state management on top of the Metal APIs.
    • A scene-graph-like system which enables building real-time and path-tracing based renderers.

Supported GPUs

  • Apple Silicon GPU is supposed to be the only GPU working on macOS in the future.
    • M1 Max.

⚠️❗The whole Intel Mac product line has been terminated. AMD eGPU support is obsoleted.

  • Intel HD serious GPUs are not supported. (Built-in integrated GPU in most models of Mac.)
  • AMD Radeon Pro 560, and built-in descrete GPUs in almost all MacBook Pro later than 2017, are barely suppored. Their performance would be poor for the ray tracing rendering.
  • For early macOS on Intel supporting eGPU, AMD Radeon RX 580 or above is recommended, in particular but not limited to:
    • AMD Radeon RX Vega 56 is recommended.
    • AMD Radeon RX Vega 64, RX 5700, and so on, should be working, but untested.
    • AMD Radeon VII is highly recommended.
    • AMD Radeon Pro Vega II (Duo) (in the Mac Pro 2019). [1]
    • AMD Radeon Pro W5700. [1]

[1] Acknowledge to @ibuick for the verification.

Latest Update

  • Apple Silicon and macOS 13.3 adaptive.
    • High dynamic range display.
    • Replace the Performance Shader Intersector with Metal Ray Tracing shader.
  • Specular lighting on a Fresnel surface.
  • Multiple-importance sampling.
  • Slider with adjustable scale.
  • Full ray tracing.

  • Hybrid rendering with ray tracing.
    • Direct lighting soft shadow.
    • Indirect lighting (ambient) with physically-based occlusion.
    • Physically based effect for the shadow overlay (blend-in with photographic scene).
    • Self-illuminating objects.
  • Checkerboard background for better inspecting the result transparency.

  • Inspecting intremediate textures in debug.

  • Overlay indicator for selected parts.

  • Transformation on the entire scene accurately around the scene's center.
  • More accurate bounds calculation (improving shadow map sampling quality).
  • User selection on GPU.
  • Better take advantage of dedicated video memory by using private buffers. Especially important for desktop-class graphics card or external GPU).
  • Background loading.
  • Motion blur.
  • Blending with real-scene background.

  • Ambient occlusion.

  • Transform of the entire scene (including the light sources).
  • Better PCSS soft shadow

  • Ground shadow

  • Skybox.

  • BRDF mode. Fix artifacts in specular lighting.
  • Save to high resolution PNG (up to 3900 px).
  • Rotate individual parts (mandatory for the varying-geometry wing plane model!).

  • Adjustable shadowing PCF and bias to alliviate artifacts.
  • Preliminary shadowing for two of the four light sources.

  • Load/save scene parameters (postion, light source direction, etc.).
  • Normal texture.
  • Light source configuration.
  • Multiple light sources.

  • Adjustable lighting direction.
  • Better handling to material opacity.

Screenshots on Development

TODO

  • 🔲 Camera model.
    • 🔲 Depth of field. Lens blur.
  • 🕒 Order-independent transparency.
  • 🔲 Bump (displacement) texture.
  • 🕒 Support PBRT format.
  • ✅ Normal texture.
  • ✅ Direction of lgiht source.
  • ✅ Intensity of light source.
  • ✅ Mutilple light sources.
  • ✅ Selectable list of object.
  • ✅ Surface smooth.
  • Shadow
    • ✅ Shadow to model.
    • ✅ Shadow to ground.
    • PCSS.
      • ✅ Basic PCSS.
      • ✅ Adjustable occluder search range.
      • ✅ More adjustable bias.
    • ✅ Transparency (strength) of shadow overlay. (Achieved by ambient)
    • Linear shadow map (more plausible PCSS, VSM).
    • Adaptive shadow map resolution/region.
  • ✅ Per light-source, per-surface shadow properties (bias, soft edge).
  • ✅ Cull mode.
  • Surrounding.
    • ✅ Cubemap skybox.
    • Water (for ship model).
  • ✅ Motion blur (especially for rotating parts like rotor).
  • Detailed properties panel for indiviudal model parts.
    • ✅ Smooth options (everywhere, texture discontinuiation only, etc).
    • ✅ Material opacity adjustment.
    • Material adjustment (specular, colors, etc).
    • List of board objects.
    • ✅ Self illumination.
  • Ray tracing
    • 🕒 Faster buffer construction.
    • ✅ Ground reflection.
    • ✅ Specular term in direct lighting shadow, and in global illumniation.
    • 🕒 Light source surface sampling.
    • ✅ Shadow ray visibility.
    • Multiple importance sampling. Unified reflection model.
    • 🔲 Normal map.
    • Specular map.
    • 🔲 Translucent map.
  • ✅ BRDF mode.
  • ✅ Ambient occlusion.
  • Model visualization
    • ✅ PCSS steps visualization.
    • Triangle mesh
    • Normal/tangent visualization

Early Screenshots

Screenshot of the first version (left). Add support to simple transparency (right).

nuomodelviewer's People

Contributors

middlefeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nuomodelviewer's Issues

Error while compiling

Hi thanks for your awesome project and sharing,

I have the following error while open the ModelViewer.xcodeproj:

/Users/ben/ben_ws/mac_dev/NuoModelViewer/ModelViewer/ViewerFoundation/Meshes/ShadersCommon.h:66:52: 'function_constant' attribute requires metal language to be 1.2 or higher

Pretty much new to metal, any tips on this? Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.