Three.js Pixel Shader Update

Made the shader more heavily pixelated and made edge highlights only one pixel thick.
Inspired by t3ssel8r's work: / @t3ssel8r
Thanks to Omar Shehata for his tutorial on writing an outline pass: / how-to-render-outlines...
Source: github.com/KodyJKing/hello-th...

Пікірлер: 85

  • @t3ssel8r
    @t3ssel8r2 жыл бұрын

    nice work! it's definitely an interesting problem. this new video shows off some pretty challenging cases that I think you handled well

  • @jamesking2439

    @jamesking2439

    2 жыл бұрын

    Thanks! I'm pretty happy with my outlines now, but I still don't understand how you avoid jittering when translating.

  • @Art-uz3fk

    @Art-uz3fk

    2 жыл бұрын

    @@jamesking2439 isn't that just part of the aesthetic.. that's what pixels do? Noita is a good example the crate graphic looks clean upright and then at an angle it gets all pixely since it was originally drawn as an upright graphic and the game renders each pixel individually

  • @jamesking2439

    @jamesking2439

    2 жыл бұрын

    ​@@Art-uz3fk That doesn't have to be the case with translation if you snap to a pixel grid. It's just that I haven't figured out how to do that in 3D.

  • @BooshyBrows

    @BooshyBrows

    2 жыл бұрын

    @@jamesking2439 you need to be using an orthographic projection (looks like you are) and then do a lot of maths to convert world space distance into camera space pixels. If you start from a simple top down / side on camera angle you can build on it from there

  • @Soyaa

    @Soyaa

    2 жыл бұрын

    @@jamesking2439 Im following, avoiding jittering is a mystery to me too

  • @racingindie2168
    @racingindie21682 жыл бұрын

    Dude, amazing work, that looks really cute and amazing at the same time!

  • @antoniobento6813
    @antoniobento68132 жыл бұрын

    I can't stress enough how cool this... I've been blown away with three.js for quite some time but this is so neat

  • @starbi
    @starbi2 жыл бұрын

    That looks great. It really feels like there is a sub-community building around t3ssel8rs work, haha. Thank you for sharing the source! There are barely any pixel perfect edge detection implementations out there.

  • @jamesking2439

    @jamesking2439

    2 жыл бұрын

    Thanks. Yeah, I think t3ssel8r proved that good looking procedural pixel art was possible.

  • @LePichu
    @LePichu2 жыл бұрын

    I'd just like to say thank you so much, I've been looking for this for so long now, I had lost hope but I discovered your channel today. The fact that this is open sourced makes me happy on another level, me and my friends recently started open sourced game development and we wanted to recreate Dead Cells' animation and rendering system but school took a heavy tool and I couldn't get to learn GLSL or be involved in researching much, this saves us a lot of time, I can't thank you enough! and finally, another thank you!

  • @jamesking2439

    @jamesking2439

    2 жыл бұрын

    Glad I could help. Best of luck on the game!

  • @LePichu

    @LePichu

    2 жыл бұрын

    @@jamesking2439 Thanks again, I'll be checking progress time to time. :)

  • @SeanStClair-cr9jl
    @SeanStClair-cr9jl3 ай бұрын

    This outcome looks really good

  • @LollyPoppi
    @LollyPoppi Жыл бұрын

    This is exactly what i looking for, but with Unity. This kind of white inner line, is so pretty!

  • @TheLucifurry
    @TheLucifurry2 жыл бұрын

    Omg, it's perfect, thanks! I thought, its impossible to make a pixelart shader with hight quality

  • @ZimoNitrome
    @ZimoNitrome3 ай бұрын

    This is awesome!

  • @nav9
    @nav92 жыл бұрын

    looks awesome

  • @thomassynths
    @thomassynths2 жыл бұрын

    I'm going to have to take a look at the source code sometime. Thanks! I love the look

  • @thatsmaik
    @thatsmaik2 жыл бұрын

    This is awesome! Thanks for sharing :)

  • @AlphaCollectorCZ
    @AlphaCollectorCZАй бұрын

    Wow this is awesome

  • @Staeufer
    @Staeufer2 жыл бұрын

    woah unbelievable quality shader,

  • @printfhelloworld9806
    @printfhelloworld98062 жыл бұрын

    outline from normal ! it helps a lot ! thank you

  • @Julesv13
    @Julesv132 жыл бұрын

    your the best thank you for being open source !

  • @PandaBazookaWarz
    @PandaBazookaWarz2 жыл бұрын

    Open source!?! Thats really cool of you :)

  • @dailyfunnytv358
    @dailyfunnytv358 Жыл бұрын

    ok this shader is much better than others

  • @rehamb.o9534
    @rehamb.o9534 Жыл бұрын

    Amazing Channel thank you 🙏🏻

  • @1ucasvb
    @1ucasvb Жыл бұрын

    This looks so good it hurts.

  • @jamesking2439

    @jamesking2439

    Жыл бұрын

    Thank you!

  • @moofarms3474
    @moofarms34742 жыл бұрын

    look awsome king

  • @mag1kpo0p81
    @mag1kpo0p812 жыл бұрын

    I've been trying to figure out how to simulate blender's cavity option in solid shading in Godot.... it's a pain 🥲 i'm talking about that highlight on your dodecahedron's edges and like the black shadows of the cubes

  • @sigitsatriap6505
    @sigitsatriap65052 жыл бұрын

    Beautifull

  • @travisc8406
    @travisc84062 жыл бұрын

    wow thats crazy

  • @judgsmith
    @judgsmith2 жыл бұрын

    I like it.

  • @dexterwest4944
    @dexterwest49442 жыл бұрын

    Giving a whole new meaning to pixel shader lmao. Srs though this looks great!

  • @adip7060
    @adip70602 жыл бұрын

    Great stuff man! Makes me want to make a game using this

  • @jamesking2439

    @jamesking2439

    2 жыл бұрын

    That would be sick.

  • @Snookicker

    @Snookicker

    2 жыл бұрын

    @@jamesking2439 i am working on it

  • @ChrisSmith-po3di

    @ChrisSmith-po3di

    Жыл бұрын

    @@Snookicker How did it go?

  • @Snookicker

    @Snookicker

    Жыл бұрын

    @@ChrisSmith-po3di On my channel, but i need rework the shader. I m focusing on multiplayer now. :)

  • @ChrisSmith-po3di

    @ChrisSmith-po3di

    Жыл бұрын

    @@Snookicker that's so cool!

  • @pixelpanda5885
    @pixelpanda58852 жыл бұрын

    How can i learn to make this style of shading? a mini tutorial video would be super helpful!

  • @lemongummy7047
    @lemongummy70472 жыл бұрын

    Interesting!

  • @mrdoob
    @mrdoob2 жыл бұрын

    Looks great!

  • @jamesking2439

    @jamesking2439

    2 жыл бұрын

    Thanks!

  • @mrdoob

    @mrdoob

    2 жыл бұрын

    @@jamesking2439 Would you be interested in turning this into an official example?

  • @jamesking2439

    @jamesking2439

    2 жыл бұрын

    @@mrdoob Yeah, I'd really like that. :D What do I need to do?

  • @mrdoob

    @mrdoob

    2 жыл бұрын

    @@jamesking2439 Excellent! Just create a Pull Request with the code in the repo and I can clean it up if needed 👍

  • @gungriffon220
    @gungriffon2202 жыл бұрын

    what exactly is this for? is this a unity shader structure or something else? I'm curious if this sort of thing could be implemented into say, Blender for use in creating animations or something like that.

  • @SMVK
    @SMVK2 жыл бұрын

    I recently saw a fantasy pixel art GIF. And a warrior was drawn there, and in the background a small castle 🏰. But that GIF was flat and drawn. I would like to see the same (or similar) small scene only in 3D as in your video T-T that would be very cool💪T-T And if there was still a game, I would play it with great pleasure 🙈 (not complicated in terms of the plot, you can just wander around without it). I hope the translator translated correctly

  • @agrestige7390
    @agrestige7390 Жыл бұрын

    may i know the legalwork behind this? i am really impressed and would love to utilise this in my projects, great work btw!

  • @jamesking2439

    @jamesking2439

    Жыл бұрын

    Use it however you like. The source is in the description.

  • @cheesecake8423
    @cheesecake8423 Жыл бұрын

    I dont know much about 3js, but i really love this shader, if i wanted to implement this in unity, how would I do it? is there a tutorial you know of or something, I'd really love to use this for games in the future

  • @jamesking2439

    @jamesking2439

    Жыл бұрын

    This post by t3ssel8r might help give you some direction imgur.io/gallery/qwhbHQq. You can check out my shader code (in the description) as well. Alternately, you could use ProPixelizer from the asset store.

  • @Meowxdwild
    @Meowxdwild Жыл бұрын

    hi! how do we implement these shaders into unreal engine / blender / unity? i absolutely love it btw!

  • @jamesking2439

    @jamesking2439

    Жыл бұрын

    I don't know about Unreal or Blender, but for Unity, you could check out ProPixelizer. If you want to build something yourself, you can check my shader code (in the description) and look at this post by t3ssel8r imgur.io/gallery/qwhbHQq.

  • @HichemCode
    @HichemCode5 ай бұрын

    Hello, the output is amazing, and I'd like to use it in a mini game with R3F. However, I can't figure out how to make it work. Could you please provide me instructions?

  • @jamesking2439

    @jamesking2439

    5 ай бұрын

    I've never used R3F. Do they have a way of setting up post processing effects?

  • @lemonke8132
    @lemonke81322 жыл бұрын

    You see how the edges are really jaggedy, and the number of jags changes with the viewing angle? Is is possible to make a shader that has consistent pixelation?

  • @jamesking2439

    @jamesking2439

    2 жыл бұрын

    It's probably possible, but I'm not sure my approach could easily be modified to do that.

  • @johnjackson9767

    @johnjackson9767

    2 жыл бұрын

    Not using this approach, unfortunately

  • @MajatekYT

    @MajatekYT

    2 жыл бұрын

    Could be doable with this shader if you round the XYZ position of moving objects to the nearest integer relative to the 2D viewing frustum. The only reason why the jags changes shape is because the object is moving between the screen's pixels, so the shader accounts for that by rearranging the pixels so that there's a smooth transition. Basically you'd want to approach it like how a retro PS1 shader intentionally uses fixed-point math, except applied to an object's overall position, and not its vertices individually (as that's how you'd get the wobbly PS1 effect instead of the consistent pixelation effect you want).

  • @fahd2372
    @fahd23722 жыл бұрын

    Is there a difference between doing this and rendering to a low res texture and scaling it up?

  • @jamesking2439

    @jamesking2439

    2 жыл бұрын

    Yeah, if you just rendered at low resolution you wouldn't get the highlighted edges between faces or the object outlines.

  • @ben_turner
    @ben_turner2 жыл бұрын

    Woah, how can I get this working on my own Three project??

  • @jamesking2439

    @jamesking2439

    2 жыл бұрын

    I have a pull request with this effect for Three.js, but it's not merged. You could just copy this file into your project and update its imports to work outside of the Three.js package: github.com/KodyJKing/three.js/blob/outlined-pixel-example/examples/jsm/postprocessing/RenderPixelatedPass.js Here's a usage example: github.com/KodyJKing/three.js/blob/outlined-pixel-example/examples/webgl_postprocessing_pixel.html#L62 github.com/KodyJKing/three.js/blob/outlined-pixel-example/examples/webgl_postprocessing_pixel.html#L154

  • @rickdelacruz7840
    @rickdelacruz7840 Жыл бұрын

    Where to apply this?

  • @kaitino
    @kaitino8 ай бұрын

    can you use this in UE5?

  • @jamesking2439

    @jamesking2439

    8 ай бұрын

    No, but this post by t3ssel8r describes the general technique: imgur.io/gallery/qwhbHQq

  • @stormshadowoffire
    @stormshadowoffire Жыл бұрын

    How can I implement this into unity?

  • @jamesking2439

    @jamesking2439

    Жыл бұрын

    If you want a prebuilt package, I'd recommend ProPixelizer from the asset store. If you want to implement it yourself, check out this post by t3ssel8r imgur.io/gallery/qwhbHQq. You can also check out my shader code for reference. There's a link in the description.

  • @warlockpaladin2261
    @warlockpaladin2261Ай бұрын

    This has got to be used for something... where code at? 🤤

  • @jamesking2439

    @jamesking2439

    Ай бұрын

    github.com/KodyJKing/hello-threejs

  • @shakibdewan7441
    @shakibdewan7441 Жыл бұрын

    Is this shaders compatible with unity 3d? Where can i download it or buy this amazing shader?

  • @jamesking2439

    @jamesking2439

    Жыл бұрын

    My shader isn't compatible with Unity, but there's a great pixel shader called ProPixelizer on the Unity asset store.

  • @shakibdewan7441

    @shakibdewan7441

    Жыл бұрын

    @@jamesking2439 Thanks for the reply! I’ll buy this one, looks good :)

  • @codered_dev
    @codered_dev Жыл бұрын

    bro my game uses something similar

  • @thedrunkenknight
    @thedrunkenknight21 күн бұрын

    Does the source code work in unity?

  • @thedrunkenknight

    @thedrunkenknight

    21 күн бұрын

    If not would someone be able to help me get this effect working in unity? I have no idea how to code shader stuff like this, i know its a depth pass + a normal pass but I have no clue how to achieve this

  • @jamesking2439

    @jamesking2439

    20 күн бұрын

    This technique is doable in Unity, but this code would not be usable. If you want something that works out of the box, there is ProPixelizer on the asset store.

  • @thedrunkenknight

    @thedrunkenknight

    20 күн бұрын

    @@jamesking2439 hey thanks man