Recreate the PS1's Affine Texture Warping with Unity Shaders

Поділитися
Вставка
  • Опубліковано 27 жов 2021
  • The PlayStation 1 was many people's first console, but games on the system were plagued by strange graphical artifacts. One of these is called affine texture warping, which causes wall and floor textures to appear wobbly. In this tutorial, we'll look at how the modern graphics pipeline avoids this effect, then remove those features to get our own wobbly Unity games!
    ------------
    👇 Download the project on GitHub: github.com/daniel-ilett/ps1-a...
    ------------
    🎮 This project uses Unity 2020.3.2f1 and URP 10.4.0, but it should work with other versions.
    ------------
    📚 Get a copy of my shader book here: www.dpbolvw.net/click-10074214...
    ✨ Grab Snapshot Shaders Pro here: assetstore.unity.com/packages...
    ------------
    💬 Join the Discord: / discord
    💖 Support me on Patreon: www.patreon.com/danielilett?f...
    ☕ Or throw me a one-off coffee on Ko-fi: ko-fi.com/danielilett
    #unity #shaders #playstation1

КОМЕНТАРІ • 40

  • @danielilett
    @danielilett  2 роки тому +27

    This turned out to be a pretty short effect! Please excuse my shameful gameplay on Spyro at the start - been a while since I used a Steam controller on my, uhh, completely legitimate copy of the game. Enjoy!

    • @Hyphen3372
      @Hyphen3372 Рік тому +1

      Can u make this in shader graph?

  • @kitsuneandcake
    @kitsuneandcake 2 роки тому +10

    Absolutely amazingly helpful video. I did this to my project and it instantly felt that little bit extra ps1y! I really like how simple this was too, I expected to have to learn all about shaders, which I am not convinced that I should do anyway, just because of how cool this is.

  • @handleneeds3charactersormore
    @handleneeds3charactersormore 7 місяців тому +2

    I love that this video goes to the point just after some short, interesting preamble and doesn't pad out for length for 10 min, truly a distinguished YT gentleman indeed.
    Keep it up!

    • @danielilett
      @danielilett  7 місяців тому +2

      Thanks! I try not to pad things out if I can help it, so my videos have a pretty big range in runtimes. This is definitely on the shorter end.

  • @gabrifs_
    @gabrifs_ 2 роки тому +4

    Bro, awesome video, very helpful and straight to the point, thanks for sharing your knowledge!

  • @sebastianvazquez2242
    @sebastianvazquez2242 Рік тому +6

    Hi Daniel! Not sure if this is the place for this but I was wondering how I would go about applying this to an entire scene instead of individual objects. I'm still new to Unity so im not too familiar with scripts yet

  • @ffox57
    @ffox57 Рік тому

    Is there a way to make this shader have some lighting? Whenever I try cast a light source onto an object using this shader, it doesn't show the light

  • @vadiks20032
    @vadiks20032 Рік тому

    i love how bunch of people made some system called shaders vertices fragments maps UV and now we're all just using them to build a simple cube

  • @hereticstanlyhalo6916
    @hereticstanlyhalo6916 2 роки тому

    ,Is there a possible way to remove perspective on the uv map in the shader graph for URP? I had everything working on shader code, except point lights and spot lights just didn't work, only directional lighting.

  • @johntrevy1
    @johntrevy1 2 роки тому +8

    I wish there was a modern PS1 syle horror that did this along with less than 30FPS.

    • @laureldaigneault4030
      @laureldaigneault4030 2 роки тому +2

      Take a look at « Murder House » or « Nun’s Massacre ». Those games have features that make the game really look and feel like a ps1 horror game!

    • @johntrevy1
      @johntrevy1 2 роки тому +1

      @@laureldaigneault4030 Still 60FPS with no texture warping.

    • @laureldaigneault4030
      @laureldaigneault4030 2 роки тому +2

      @@johntrevy1 you are right with it not being exactly texture warping, but the game offers 30 fps mode.

  • @Siphonife
    @Siphonife 2 роки тому +1

    Where was this video 3 years ago when i was looking into unity for this exact effect xD. I wanted to pull it off myself but didnt find anything that explained it simply enough. I did find a premade shader that works pretty well but wasnt as satisfying as making it on my own.

  • @aleksp8768
    @aleksp8768 2 роки тому +2

    HELL YEAH!

  • @AlFungy
    @AlFungy Рік тому

    How do I allow lighting to work with this shader? I'm kind of an idiot when it comes to this stuff.

  • @NeatWolf
    @NeatWolf Рік тому

    Hi! I read the article and that said "This tutorial is aimed at people who have a bit of experience with Shader Graph. We are using Unity 2020.3.2f1 and URP/Shader Graph 10.4.0".
    Yet - I was trying to reproduce it using actual nodes in Shader Graph - I'd love it to make it a little module I can reuse with more complex shaders.
    Am I missing something here? Were you able to reproduce that with nodes?

    • @danielilett
      @danielilett  Рік тому +1

      Ah apologies - this is a mistake on my end! When I'm writing articles, I often copy most of the boilerplate from a previous article and I must have accidentally left in references to Shader Graph at the top. This tutorial is intended for just shader code.
      I believe it's not possible to recreate this kind of effect in Shader Graph, because you're given no control over the interpolation of variables between vertex-stage and fragment-stage.

  • @FonyWill
    @FonyWill Рік тому

    sorry for the noob question but, where can you find this script? I am new to game dev and Im trying to make a project in this style, thanks!

  • @aryn4695
    @aryn4695 Рік тому +2

    Hi Daniel, I was just curious if you knew what might be causing this, but when attempting to recreate the Affine Texture Warping shader and applying it to objects in the scene it appears as, well, invisible.
    What is strange is that in the material preview it shows the texture coming through just fine. I've tried a few things like reinstalling packages, trying it on another object, etc. but nothing seems to work. This is both in-editor & in-game. Any ideas?

    • @emmanuelsalcedo1104
      @emmanuelsalcedo1104 Рік тому +1

      hey i was having issues with this and found a fix that seemed to work with me, it has to do with the universal render pipeline. Go into Edit > Project Settings > Graphics and change the scriptable render pipeline settings to the UniversalRP. I used the one's from the github in the description. Hope this is somewhat helpful.

    • @aryn4695
      @aryn4695 Рік тому +1

      @@emmanuelsalcedo1104 Hey I'll check this out later - thanks for letting me know! I suppose that would make sense as my project did not initially have URP installed so how would it know to change it. Oops!

  • @Sean-pv1nw
    @Sean-pv1nw Рік тому

    how can you do this in unreal engine 5?

  • @user-yc3wq1hz9f
    @user-yc3wq1hz9f 8 місяців тому

    Hello, im starting out with unity and im struggling to find that Vertex Shader code you have there. Im using URP but when i create a shader, none of the options look like what you have :/

  • @xenonguillou7105
    @xenonguillou7105 2 роки тому +1

    ok but...where? how do I find the code? Where is the shader parameter ?

    • @danielilett
      @danielilett  2 роки тому

      Code is on GitHub, link is in the video description!

  • @Hyphen3372
    @Hyphen3372 Рік тому

    is it possible to make this in urp shader Graph?

    • @danielilett
      @danielilett  Рік тому +1

      Unfortunately not easily if at all, since Shader Graph doesn't provide any setting that does the same thing as the noperspective keyword.

  • @watercat1248
    @watercat1248 2 роки тому

    do you know how to do samthing like this in shredder graph ?

    • @danielilett
      @danielilett  2 роки тому +3

      There isn't an easy setting to change somewhere, so I think you'd probably need Shader Graph's custom interpolators, which I think were added in Shader Graph 12.0. I've not used them yet so I'm not exactly sure what you would need to add to the graph, though!

    • @watercat1248
      @watercat1248 2 роки тому

      @@danielilett okay don't worry

  • @AGuy387
    @AGuy387 2 роки тому +3

    Metal Gear was awesome, why wouldnt you turn out ok ? :D

    • @danielilett
      @danielilett  2 роки тому +2

      It was one of the first games I ever played haha! Not sure how well I grasped themes of nuclear disarmament and gene therapy as a 7-year-old, but yes, it's an amazing game!

    • @AGuy387
      @AGuy387 2 роки тому +4

      @@danielilett same here. I just loved hiding under the cardoard box and sneaking around ^^

  • @iwantagoodnameplease
    @iwantagoodnameplease 5 місяців тому

    The music in the game is louder than your voice :(

  • @Goofarama
    @Goofarama Місяць тому

    Is this lua script?

  • @jwenaposse305
    @jwenaposse305 2 роки тому +1

    Woaaaa this is amazing. Could you please do this in normal GLSL too?? I am using three.js. I tried doing it like this, and it sort of works but it creates very large glitches....
    --------------------------------------------------------------------------------------------------------------------------
    vertexShader:
    --------------------------------------------------------------------------------------------------------------------------
    varying vec2 vUv;
    void main()
    {
    vUv = uv;
    gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
    gl_Position /= gl_Position.w;
    }
    --------------------------------------------------------------------------------------------------------------------------
    fragmentShader:
    --------------------------------------------------------------------------------------------------------------------------
    uniform sampler2D mytexture;
    varying vec2 vUv;
    void main()
    {
    gl_FragColor = texture2D(mytexture, vUv );
    }
    --------------------------------------------------------------------------------------------------------------------------

    • @danielilett
      @danielilett  2 роки тому

      Been a while since I last did GLSL shaders! I know the noperspective keyword exists in GLSL - does that method work for you?