Search Unity

Creating levels with PS1 graphics limits

Discussion in 'Game Design' started by Hertzole, Jan 12, 2020.

  1. Hertzole

    Hertzole

    Joined:
    Jul 27, 2013
    Posts:
    422
    Hi!

    I'm making a game with some PS1 graphics (vertex inaccuracy, texture warping, and all that good stuff) but I'm having trouble with creating my in-door levels. The texture warping really holds me back when using the way I want to create levels, using realtime CSG. It makes my life so much easier to prototype and such, but due to the way it builds the mesh, texture warping because a big issue due to the lack of frequent vertices.

    One solution would be to build my entire levels using quads but that would be extremely time consuming and having to line up textures properly would be a pain if I decided to do anything "slightly fancy".

    Another solution is to build with ProBuilder and subdivide faces, but that way the mesh becomes really hard to work with, and I honestly feel like making stuff with ProBuilder is tedious by itself due to the destructive nature of direct mesh editing.

    One last solution that I haven't confirmed if it works or not is to have the shader somehow add extra vertices but I don't know how efficient that would be and if it's even possible. I know tesselation is a thing but from what I can see it makes some weird shapes and I would just prefer a grid pattern of some sort.

    So how would you do it so it doesn't become a big pain to build levels? :)
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,145
    Unless you need vertex warping to factor into the gameplay itself, I recommend:
    1. Build levels as normal, but do not use the warping shader
    2. Export your geometry as an fbx file
    3. Load into the 3d modelling program of your choice
    4. Use the cut feature in there to give you some nice, even quads
    5. Save
    6. Import back into Unity
    7. Now you use the shader.
    It's your standard art pass workflow, really. You save the cutting for the end as it's part of your art pass, rather than as the basis for how you're working.
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    This reply is based on a lack of information about the problem, so I'll talk about common vertex distortion issues with shaders to hopefully add more information to the discussion.

    You guys sure these shaders require regular spaced verts? In my experience any shaders that deform verts have to be written in such a way that their deformation offset value is shared by the vert next to it.

    A lazy way people write shaders with movement noise is using UVs or other value which might not be shared by the vert in the same space.

    Whenever a different texture or smoothing group is needed in a model, the model is actually internally split by the 3D package so really, there's more verts there than you author with. CSG is no different.

    If it's all 1 single mesh with 1 texture with fused verts it'll probably work fine. You could even kitbash a world together like this, made of fused meshes.

    The alternative is either to find a better PS1 shader or embed better information in the verts so they may mathematically distort deterministically based off those values then it doesn't really matter how it's made.

    Alternative suggestion based on original premise:

    Let's assume the problem is actually not that but just a lack of regular spacing. If this is the case, you can't really fix it by chopping it up in a 3D package. there are far too many floating verts at that point. It would instead be better to use a vertex painter Unity side to just embed a little more information into vert cols or a vert stream, to indicate where it shouldn't apply the effect, so any black verts are multiplied by the effect in the shader to prevent the effect working there. This way you could quickly live paint out the errors.
     
    Hertzole likes this.
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That reminds me, @bgolus had some advice on PS1 shaders if I remember and will be far better at this than I because he has a neverending story avatar and years of pro experience ;)
     
    BrandyStarbrite likes this.
  5. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,145
    Keijiro also has a free package, from which all those shaders are basically derived.

    https://github.com/keijiro/Retro3D

    You do need to subdivide things because otherwise the perspective correction (or lack thereof) ends up making it difficult to parse where you are in 3D space. It's a delicate balance of retaining an authentic look while also keeping things readable. That and the change in geometric precision means you really do have to divide things into relatively even quads.

    There are programmatic ways to handle it, but if I'm being real? They aren't worth the overhead and making it part of the art pass allows you to manually adjust consistency a lot easier in case you need to deal with edge case situations.

    edit: I should note that I'm speaking from experience here. This was an aesthetic I was experimenting with for years until I settled on my current preference.
     
  6. Hertzole

    Hertzole

    Joined:
    Jul 27, 2013
    Posts:
    422
    Making the level and then exporting it to cut it up in another program sounds like a reasonable solution! I've just never really got around to properly learning any of them but doesn't seem too hard to do it Blender. Thanks for the suggestion!

    EDIT: It was a cool idea until I realized Blender can't import ASCII FBX files for some reason and that's the only export option I got...
     
    Last edited: Jan 12, 2020
  7. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    Blender FBX importer/exporter


    I'm not a blender user myself so I can't vouch for this tool ^, however I do know that many professionals who use blender do often rely on plugins. So if you need Blender to do something that isn't totally novel, chances are you got some plugin for it.
     
    Hertzole likes this.
  8. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,145
    Honestly, for this reason you don't really need to worry about plugins. Blender's FBX to/from Unity is fine so long as you remember to click "!EXPERIMENTAL! Apply Transform" near the bottom.

    upload_2020-1-12_14-1-4.png
     
    JoeStrout, Hertzole and BIGTIMEMASTER like this.