GithubHelp home page GithubHelp logo

menacingmecha / godot-psx-style-demo Goto Github PK

View Code? Open in Web Editor NEW
596.0 15.0 30.0 8.96 MB

Demo project featuring a collection of PS1 style shaders and materials for Godot engine.

License: MIT License

GDScript 100.00%
godot shaders ps1 psx low-poly pixel-art game-development game-engine gamedev retro

godot-psx-style-demo's Introduction

Godot PSX Style Demo

Play demo in browser!

Example Screenshot

A collection of shaders and materials for Godot engine that aim to recreate the following aspects of the PS1 aesthetic:

  • Vertex "snapping"
  • "Wobbly" texures through affine texture mapping
  • Limited color depth
  • Hardware dithering to hide color banding
  • Shiny chrome-like metallic surfaces
  • Billboard sprites
  • Fog to limit draw distance

Originally based on: https://github.com/marmitoTH/godot-psx-shaders

Floor texture (available under CC-0): https://stealthix.itch.io/rpg-nature-tileset

Design Goals

These shaders are focused on having as few parameters as possible to achieve the desired effect of recreating (most of) the PS1's rendering quirks. This is to aid accessibility by way of reducing the amount of things the user has to understand and configure.

However, this is at the cost of customizability; there are fewer parameters to highly tweak how the shaders look versus other projects.

Demo Controls

  • Space: Toggle camera and object movement
  • R: Reset scene

Usage

Brand new projects

For brand new projects, I would reccomend duplicating this project and playing around with things from there.

Existing projects

  1. Add the contents of shaders/ to your project.
  2. Add the precision_multiplier as a float shader global in Project Settings, ensuring it's value is minimum 0 (non-inclusive), and maximum 1 (inclusive).
  3. Configure a Dither/Banding viewport shader, using the demo project as reference.

Tips for best results

  • Use very low poly models
    • Prefer smooth-shading over flat-shading wherever possible
    • Don't be afraid to include extra edge loops to smooth out texture distortion in your geometry! PS1 levels often had much higher polycounts than you might expect!
  • Keep textures as low resolution as you can
    • Make sure filtering and mip-maps are both disabled
    • Rely on a mix of vertex colours and texture maps, instead of higher detailed texture maps wherever possible
    • Posterizing your textures with a depth of 15 or 16 before import goes a long way to making them feel more "PS1"
  • Keep your internal resolution low
    • Common PS1 resolutions were 256ร—240, 320x240 and 512x240 (Source)
    • That being said, you can easily go widescreen by using a 16:9 resolution with similar height
  • Use as basic of a lighting set up as you can get away with
    • Modern lighting techniques are a very easy way to break the illusion of appearing like early 3D!
    • Where possible, prefer to use white ambient light, with vertex colours on geometry to fake lighting
  • Prefer additive blending to transparent blending

Changes from v1.x

Major version change

This version is for Godot 4.x only. Please refer to the v1.x branch for Godot 3.x support.

Fog

Godot 4.0 changed how environmental fog worked, the key part being the removal of the "start distance" and "end distance" properties. While a manual workaround could be implemented, there is work being done to restore this functionality in a later version.

Runtime options

In order to release working Godot 4 shaders as soon as possible, runtime options for the demo will be re-implemented at a later date.

Games using these shaders (in some form)

Please submit a PR (or send a message) if you have a title to add!

godot-psx-style-demo's People

Contributors

menacingmecha avatar ppboxhead avatar scriptsengineer avatar tarasophiedev 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

godot-psx-style-demo's Issues

Invalid render mode: 'LIT'.

image
Meshes with any shader from this repo appear invisible for me, even after I followed all the instructions in the description (including adding the precision_multiplier float in shader globals). I don't think this supposed to happen... shader parameters seem to be working, but no matter what shader parameter I change, the mesh becomes invisible with any of the shaders. Am I doing something wrong?

Split demo and shaders into seperate repos?

Looking for thoughts and feedback on if the demo should be split from the shaders, and include the shaders in the demo by way of git submodules.

Main reasoning for this would be to help with ease of adding to projects. As it stands, users have to copy-paste individual files, which is both messier than it could be, and often includes a lot of assets that users won't need for their projects.

Additionally, we could reduce copied work even further by merging the demos for the PSX and N64 shaders, while keeping the shaders separate in submodules.

Main drawback I can think of is it would complicate where to leave issues, but I don't think that'd be much of an issue.

Thoughts?

Unknown identifier errors

Running on Godot 4.0.2.stable

in lcd_post_process.gdshader:
line 33: Unknown identifier in expression: 'TEXTURE'.
in post_process_blur.gdshader:
line 52: Unknown identifier in expression: 'TEXTURE_PIXEL_SIZE'.
in pp_band-dither.gdshader:
line 9: Unknown identifier in expression: 'TEXTURE'.

and an invalid render mode error in psx_base.gdshaderinc:
line 1: Invalid render mode: 'LIT'.

ShaderMaterials are broken in the latest version of Godot

image
I made a new Forward+ project in Godot v4.1.1.stable.official [bd6af8e0e] with just a camera and a MeshInstance3D that has a sphere mesh with a shadermaterial that uses the psx_lit shader just to see if this was just broken in more than one project. It's invisible once I run the project, and it's also throwing errors and warnings in the debugger and output. There's also no color parameters to be changed or image textures to be added in shader parameters like there used to be.
This project has all the files from the shaders folder in this repository. I don't think I am missing any files.

Lighting becomes "blocky" under certain conditions

Not entirely sure what causes it but often when the camera gets close to a light source a blocky outline of the light can be seen. It should have something to do with the affine mapping POSITION /= abs(POSITION.w); line because I removed the rest of the shader and the blocky effect remains until I comment it out.

Interestingly you can also get the effect with the default godot shader if you crank the light's attenuation to some crazy values so maybe that'll give some clues as to what's going on

I have an example project that shows both
godot-psx blocky lighting.zip

Stuck at low FPS for no discernible reason.

I can't find the source for this limitation in the demo. Even though process time with my RTX 3050 is about 3ms (300FPS), the final render comes out at... 40ms a frame?
Even tried removing all shaders from the main scene but no clues.

images:
image
image

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.