Coder Social home page Coder Social logo

pierodn / gdevice Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 44.98 MB

Parallel Computing Engine

License: GNU General Public License v3.0

C++ 67.69% C 12.59% GLSL 18.64% C# 1.08%
rendering parallel-computing terrain-generation rendering-engine procedural-generation gpgpu terrain-rendering demoscene procedural-terrain

gdevice's Issues

Channels

  • GitHub
  • Patreon
  • ko-fi.com
  • Kickstarter
  • IDA crowdfunding
  • YouTube (tutorials)
  • Medium

ARCHITECTURE

Separate application logic from engine

  • SOC
    • application logic to application
    • terrain LOD to parallel spatial
    • terrain generation to generator
    • renderer to renderer

Application deals with OS and GPU

  • Shared memory (Buffer<>), barriers
  • Renderer<OpenGL|Vulkan...>
  • ECS design: Node<Heightmap>
  • Serializable<Image>
  • Remove Light, IndexBuffer, etc.
  • Disentangle Node from Renderer.
  • Disentangle Node<Heightmap> too
  • VertexBuffer = array of buffers
  • Texture = array of buffers

Rendering Engine

  • Renderer<Vulkan>
  • RenderingContext
  • Scenegraph
    • Node<Terrain>
    • Node<Clipmap>
    • ECS
  • Shader<GLSL>

Improve tessellation

  • FIX normal !!
  • Vertical tessellation
  • Improve extrusion
  • Hard verticality (inject 2nd point)

Procedural material


Parameters

  • Shader parameters
    • vec4 detailmap
    • vec4[4] colors
      alpha = specularity [-1..1]
  • Vertex parameters
    • vec4 mixmap
    • vec4 color
      alpha = specularity [-1..1]

How this is supposed to work

  • A material is a set of 4 fixed luma textures and 4 corresponding colors.
  • It is set per draw call.
  • Every vertex comes with a mixmap that will tell how to mix the 4 textures.
  • When [0..1], the dot(mixmap, detailmap) becomes the 5h texture and it gets the vertex color.
  • When [-1..0], they mix by height (together with the 5h one).

Acceptance test

  • polished stone
  • muddy ground
  • rusty copper
  • icy rock
  • sand (with shiny particles)
  • snow (with shiny particles)
  • Shadertoy material editor

Comparison with PBR

  • Specularity is Roughness and includes Metallicity.
  • Albedo or diffuse color is just color (and it is F0).

Texturing splatting

  • Use asphalt detail at LOD0.
  • Tweak smoothsteps: outcrops
  • FIX get the detail color in.

RENDERING

  • Vertex shader
    • Clipmaps blending (LOD)
  • Tessellation control shader
  • Tessellation evaluation shader
    • Micropolygons (LOD)
    • Hard verticality (inject 2nd point)
    • Vertical tessellation (sediments?)
    • LOD0/LOD1 scheme (?)
    • Domain warping (?)
    • Grid adapts to intended geometry (?)
    • Heightmap onto manifold (?)
  • Geometry shader
    • Replace polygon with model
    • Additional details
  • Fragment shader
    • Procedural material
      • Mix mode
      • Repetition removal
      • Procedural gloss
      • Parallax mapping
      • Sub-pixel normal mapping
    • Direct light
      • Diffuse
      • Specular
    • Indirect light
      • Backlighting
      • Sky
      • Fresnel
    • Volumetric rendering
      • Atmospheric scattering
      • Shadows (LF)
      • Clouds
    • Edge antialiasing
  • Control keys

Collect all functions in a DLL with a nice API

  • Ideas
    • C# CUDA alternatives
    • Scene node as list of CPU or GPU Tasks.
  • - [ ] Just 1 function at a time
    • ECS-Scenegraph based?
      • C# version: Task based scenegraph
      • A scene is a graph where every node is a set of tasks
      • CUDA alternatives
        doc
      • Node types: camera, geometry, light, point
      • Is every node also a TransformNode ?
      • Are only leaf-nodes the ones containing visual stuff (gometry or imposter) ?
      • Is a node a camera node when its transform is a camera transform?
      • Would a camera node automatically get a window (or display) Rendering Context?
        • Node camera = AddNewNode()
        • camera.SetTransform( new CameraTransform() )
        • // Would its window closure imply the deactivation of the camera node?
        • while(camera.isActive)
  • VS2008 solution
    • gdevice.dll
      • C API
      • Dry C++ implementation
      • Tiny
      • Slang
      • GLFW (for a mp window)
    • walker.exe (C++)
    • walkerC.exe
    • walkerCS.exe
    • walkerPy.exe
    • gcompiler.exe → GLSL binaries
    • C# tests ?
  • VS2022 solution

Fixes batch

  • FIX hard edges in terrain generation
    • mind shadow consistency
  • FIX current textures defects (paint)
  • FIX tessellated and displaced normal
  • FIX tessellated shadow aliasing?
  • FIX get the detail color back in
  • FIX tile repetition (iq example)
  • FIX triplanar bug (with dFdx?)
  • FIX tile repetition and triplanar bug?
  • FIX tone mapping for sand or snow
  • FIX aliasing on polygons edges
  • FIX resizable window
  • FIX fullscreen ⮂ windowed
  • FIX terrain collisions
  • FIX precompute away from Fragment
  • FIX lighting defect in Fresnel

Improve design

  • Check GLSL types against this
  • Modularity: demo.exe + gdevice.dll
  • Implement ECS in Node
  • Generate textures: example
  • Remove asset/textures/terrain
  • FIX make shader error system robust
  • FIX compile error with Quadro T2000
  • FIX compile error with RTX3000
  • FIX shaders for Intel (?)

Rewards

  • Documentation (GitHub Wiki)
  • Journal (GitHub pages)
  • Sub-projects
  • Tutorials (GitHub pages + YouTube)

Improve tessellation

  • FIX normal !!
    • Move dotN0L from FS to TES
    • FIX scale !!
    • FIX dH in FS (bumps)
  • Antialiased tessellation
  • Vertical tessellation
  • Improve extrusion
  • Hard verticality (inject 2nd point)
  • Precompute more in TES
    • dotN0L (shadows)
    • distance

Optimizations

  • Precompute before Fragment
  • Precompute ambient dome?
  • Avoid lfShadow in dome?

Improve design

  • Implement ECS in Node
  • demo.exe + gdevice.dll
  • Fix compile error with Quadro T2000
  • Fix compile error with RTX3000

FIX terrain discontinuities

  • FIX clamping discontinuities (those that generate hard shadow seams).
  • FIX noise discontinuities (mostly visible on Intel).
  • FIX texture discontinuties.

Control keys

  • F1: Wireframe+Tiles
  • F2: Color
    • vertex color
    • texture generated
    • occlusion map
    • normal map
  • F3-F4: Added detail
    • Tessellate
    • Bumps+Micro
  • F5-F9: Light components
    • Diffuse
    • Specular
    • Backlighting
    • Sky
    • Fresnel
  • F10-F12: Volumetrics
    • Light scattering
    • Shadow
    • Clouds
  • P: PBR

Terrain and erosion


  • Make rocky chunks in mountains.
  • FIX Peaks and sharp edges
    (with 2x2 filter and derivatives?)
  • Add larger and smaller outcrops.
  • More packed (pow?) and less packed.
  • Cobs path on saddle points.
  • Improve shadow consistency
  • Rocky or pseudo metallic artifacts
  • Additional erosion map
  • Increase tessellation on verticalities
    • Displace like strata
  • One master SCALE.

More things to try out:

  • Hybrid<Max(triangular<Cones>)>
  • Octave Derivative: dt = F(t1-t0)
  • dt.z → clip spikes (by height)
  • dt.xy → extra ridges (?)
  • Quantization
  • Triangular cones for extra ridges

Defects

  • Smooth edges in triangular noise
  • Spilling blue in the log
    (only Windows 11?)

Terrain

  • Erosion
    • Curl on steep: video
    • Gabor on steep
    • Dump
    • Rock
    • Flow map
  • Artifacts
  • Paths

More things to try out:

  • Hybrid<Max(triangular<Cones>)>
  • Octave Derivative: dt = F(t1-t0)
  • dt.z → clip spikes (by height)
  • dt.xy → extra ridges (?)
  • Quantization
  • Triangular cones for extra ridges

Advertise

  • Video teasers
  • Write in game blogs

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.