Code Monkey home page Code Monkey logo

lambda-core's Introduction

GoDoc Go report card GolangCI codecov CircleCI

Lambda Core

Lambda Core provides a semi-comprehensive set of tools to build practically any Source Engine tool from. Any module can be used in isolation, but its recommended to utilise at least the FileSystem and ResourceManager modules if any loader is used.

See https://github.com/galaco/Lambda-Client for a working BSP renderer built on top of this library.

Current features

  • GameInfo.txt parser for existing games
  • Full filesystem loader and searcher for all GameInfo defined paths, including pakfile and vpks
  • Vmt and Vtf parsing
  • Basic .mdl parsing (useable, incomplete)
  • Full bsp loading utilities

Contributing

There is loads to do! Right now there are a few core issues that need fixing, and loads of fundamental features to add. Here are just a few!

  • StudioModel library needs finishing before props can be properly added. There are some issues around multiple stripgroups per mesh, multiple materials per prop, mdl data not fully loaded, and likely more
  • Implement physics (probably bullet physics? Accurate VPhysics is probably not worthwhile, but needs investigation)
  • Displacement support incomplete - generation is buggy, and visibility checks cull displacements always (visible when outside of world only)
  • Additional game support/testing in BSP library

Some documentation

Entity

Provides an interface, and generic implementation of a game entity, as well as 3d transform struct and camera implementation.

Event

Event provides a very simple emitter/subscriber manager to allow engine event processing. It can be used for handling internal engine events, or for game logic, although that isn't recommended.

Filesystem

Source Engine is a little annoying in that there are potentially unlimited possible locations that engine resources can be located. Filesystem provides a way to register and organise any potential resource path or filesystem, while preserving filesystem type search priority.

Loader

Loader generates data structures for Source formats from file streams. Materials, textures, meshes etc.

Logger

Logger is a simple module to abstract out different print() priorities, and (eventually) locations than just stdout.

Material

Material provides a more GPU friendly vmt material implementation

Mesh

Provides a set of common data formats for vertex data in the bsp or compiled .mdl props.

Model

Models are combinations of simple data structures that represent a single higher level visual object. e.g. []Mesh is a studio model, []Face is bsp data etc.

Resource

Resource provides a management struct for tracking what game resources have been loaded from the filesystem. When a map is loaded, all found materials, textures, models should be added to the ResourceManager, so they can be loaded only once, and cleaned up correctly when no longer needed.

Scene

Provides a simple scene struct that contains bsp face and staticprop information

Texture

Provides a set of GPU friendly texture formats. For now OpenGL usage is enforced, but abstracting that out should be doable.

lambda-core's People

Contributors

galaco avatar imgbotapp avatar renovate-bot avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

lambda-core's Issues

Add back face culling

Enable back face culling.

In theory this should be setting the opengl flag when initializing the renderer.

It may not be that simple though. scene/loader/worldspawn.go splits quad or higher faces into triangles. That code wasn't written to account for back face culling, there could be unintentional culled faces. If that is the case, splitting faces should be modified to account for face normal direction (and winding order i think) when writing vertex order for new triangles

Displacements and visdata

Displacements are currently forcibly rendered at all times. Search for dispFaces to find the relevant code.

Visibility optimisation needs to incorporate displacement faces

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
  • circleci/golang 1.17
gomod
go.mod
  • go 1.13
  • github.com/galaco/KeyValues v1.4.1
  • github.com/galaco/bsp v0.3.0
  • github.com/galaco/loggy v0.0.0-20190629005848-af043014a903@af043014a903
  • github.com/galaco/source-tools-common v0.1.0
  • github.com/galaco/studiomodel v0.1.3
  • github.com/galaco/vmf v1.0.0
  • github.com/galaco/vpk2 v0.0.0-20181012095330-21e4d1f6c888@21e4d1f6c888
  • github.com/galaco/vtf v1.1.1
  • github.com/go-gl/mathgl v0.0.0-20190713194549-592312d8590a@592312d8590a
  • github.com/galaco/filesystem v0.1.3
  • github.com/galaco/stringtable v0.1.1
  • github.com/galaco/vmt v0.1.3

  • Check this box to trigger a request for Renovate to run again on this repository

Faulty displacement loading

Many displacements look mostly correct, but many vertices along edges mismatch neighbouring displacement vertices, creating holes in between displacements.

This only appears to affect the z axis in tested maps, but that may be coincidence

Investigate threading of resource loading

There is potential for load improvements by threading/goroutining material loading. Most materials are referenced ahead of world loading in the material dictionary. In theory these could be loaded simultaneously first, instead of consecutively as they are now

Lightmaps are corrupted

Render with lightmaps enabled seems to work consistantly without errors, but most (95% or so) of faces are corrupt or warped in some way.

This is probably due to either wrong lightmap coordinates generated for face, or incorrect samples used when generating the lightmap texture

Finish Texture Atlas implementation; refactor lightmaps to use it

An example Texture Atlas struct exists, with relevant definitions already complete. The packing function however is not written. This needs finishing.

Lightmaps can then be refactored to use a common Atlas texture, rather than generating a texture per face from pre-calculated samples.

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.