Using Compute Shaders for World Texture Painting in my VR Game with Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ธ.ค. 2024

ความคิดเห็น • 13

  • @mr.watermeal5947
    @mr.watermeal5947 2 ปีที่แล้ว +4

    This is a really well put together video. The liquid looks great! It’s fun seeing this game develop.

  • @chanceslaughter3237
    @chanceslaughter3237 2 ปีที่แล้ว +4

    reminds me of portal 2 speed and bouncy goo, but this looks a lot better... well done!

    • @LoneDeveloper
      @LoneDeveloper  2 ปีที่แล้ว +2

      yes, this was a huge part of my inspiration, thanks!

  • @ahmay
    @ahmay 2 ปีที่แล้ว +4

    It would be really great If you could share the source because It's almost impossible for us to figure out the 'magic' from your narrative.

  • @Theawesomeking4444
    @Theawesomeking4444 2 ปีที่แล้ว +6

    Interesting, I remember the first time i made a compute shader in opengl, it was to make the fluid simulation i made a bit faster
    in one of the versions the simulation increased performance by 3 times (integrated gpu) against the multithreaded 4 core 3.5 ghz
    the other version performed 10 times worse in the gpu
    apparently gpus dont like branching that much

  • @wtmftproductions
    @wtmftproductions 3 หลายเดือนก่อน

    Any chance you'll share your code? I need to learn how to do this.

  • @nicholasreynolds6395
    @nicholasreynolds6395 2 ปีที่แล้ว +1

    I am asking this super late so might not ever get an answer, but how are you translating 3D positions from particles into the correct UV coordinates on only the GPU for your Compute Shader? Just curious since it seemed like in your video you stated you only needed to pass data between the GPU and CPU when you need to read data but not to write any data like uv coordinates. Do you still need to supply a uv coordinate in a buffer to the Compute Shader that you dispatch based on the position of a particle?

    • @KeegansLife
      @KeegansLife 2 ปีที่แล้ว +1

      Not sure if this is what you're looking for but I think Texture2D.GetPixel() can help get those coordinates and pass on to the compute shader

  • @kchomontiei
    @kchomontiei 2 ปีที่แล้ว +1

    Incredible work mate! well done!, im looking forward doing something similar with a proyect im working on and i really cant figure it out. i would really apreciate some tips

    • @LoneDeveloper
      @LoneDeveloper  2 ปีที่แล้ว +6

      Thank you! As for tips, this is basically just texture painting onto the secondary UV map of a mesh. Here's some relevant documentation that may be helpful to you, assuming you're also using Unity:
      Getting secondary uv map coords from raycast hit , this can be done on a per-particle basis docs.unity3d.com/ScriptReference/RaycastHit-textureCoord2.html
      You're going to want to draw your texture data based on the raycast hit data and send that to a render texture using a compute shader:
      docs.unity3d.com/ScriptReference/RenderTexture.html
      docs.unity3d.com/ScriptReference/Graphics.Blit.html
      docs.unity3d.com/Manual/class-ComputeShader.html
      Hope this helps!

  • @FootYT
    @FootYT 2 ปีที่แล้ว

    Hey, Is The TTDT Project done for?

  • @landenwah9480
    @landenwah9480 2 ปีที่แล้ว

    is the game you are making going to have a story like boneworks or half life alyx

    • @LoneDeveloper
      @LoneDeveloper  2 ปีที่แล้ว

      yes it will have a loose story!