Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to make this kind of shader?

Discussion in 'Shaders' started by Loading97, Jul 2, 2018.

  1. Loading97

    Loading97

    Joined:
    Apr 16, 2017
    Posts:
    3
    So, some weeks ago i came across with a super interesting kind of shader, but i have no clue how to create them, or where to start or look. So, the particles are just like this:



    Now, i know for a fact that you can't have any kind of custom scripts on that game, which makes "compute shaders" not possible (at least its the kind of shader that would give me a similar effect as that i think), at least with my knowledge (still kinda new to this)... So, is there anyone so kind to tell me how did they managed that, or point me out how should i look for this kind of results? I've been looking in the dark for this for 3 days now, and still can't find anything about it without needing to put custom scripts with it...

    Thank you in advance, please don't beat me too bad if the answer is obvious :D
     
  2. KILEYI

    KILEYI

    Joined:
    Mar 7, 2015
    Posts:
    52
    It is THE most common compute shader particle example you can find on internet.
    There are DX,Opengl,Unity3D,all kind of version of this one.
    Just try searching youtube with compute shader particle or tutorial,you will get it.

    Take this one for example

    https://github.com/krylov-na/Compute-shader-particles

    Yet this example need to fix some of the error cause he did NOT supply the project setting.

    If you're using Unity2017.3.1 or near version,you can try my repackage.

    https://github.com/mindoff6502/ComputeShader_Mouse

    If not,re-assign ParticlesManager.cs script to the missing script.
    Re-assign the compute shader and Particle.mat which script need.
    Re-assign Particles.shader to Particles.mat

    That will fix it,hopefully.

    And because Unity change their API everytime,so it may or may not work for other version.
     
    Last edited: Jul 2, 2018
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,248
    This kind of effect really needs a custom script to function, so I can't think of a way to do it with out. Compute shaders aren't necessarily required, but just the fact it's tracking the position of both hands makes me think the solution here is someone figured out a way around the custom script blocking, or these examples are being run in custom world and this isn't something that can be generically added to avatars.
     
  4. KILEYI

    KILEYI

    Joined:
    Mar 7, 2015
    Posts:
    52
    Sorry didn't catch that and don't know how that game works.
    If it is a unity3d game,it may support mod,if not,you still can modify the game logic and add your own code and load your own assets.And by tracking gameobject in the scene,you can find the bone or transform then you get the tracking position.
    Apply the example above,should get the same result.
    It's true Compute shaders aren't necessarily required.Built-in particle should have the same effect.

    And title is "How to make this kind of shader".

    I think that example explain everything

    The rest how that works in that game,I think better check that game community,how they support mod,or ask that video author how did he do it.
     
    Last edited: Jul 3, 2018
  5. Loading97

    Loading97

    Joined:
    Apr 16, 2017
    Posts:
    3
    you can't have any kind of scripts uploaded. And it is not on a custom world, i've seen this kind of particles on normal worlds.

    And i know it is a shader for sure, cause the game can't handle that amount of particles, and i think shaders are the only option in this case... I've come across geometry shaders on my researches, i might be able to use it to get to that result, but i still need to learn more about it and how they work
     
  6. KILEYI

    KILEYI

    Joined:
    Mar 7, 2015
    Posts:
    52
    Well, that's beyond my knowledge,sorry can't offer any useful infomation.:(
     
  7. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    Tracking the hand can maybe done with world position and vertex position (ie there is a model attach to the hand with a model), but the kind of interactivity with attraction back to the hand NEED a script.