1. Hello, Guest! This forum is now read-only. Please move to the VRChat Ask Forums. This site may be eventually removed. Move your threads and content! If you wish to archive information, now's the time to do so. https://ask.vrchat.com/

Vilar's Eye Tracking Shader

Discussion in 'Tutorials and Tools' started by Vilar, May 9, 2018.

  1. Vilar

    Vilar New Member

    Joined:
    May 9, 2018
    Messages:
    3
    Likes Received:
    4
    VRChat:
    Vilar
    I want to share a shader I created to get my eyes working while I am using full body tracking. The shader went really well, and I think it may even be a good alternative to VRChat's eye tracking even if it is available to you.

    [​IMG]

    It is available at https://github.com/Vilar24/VilarVRC

    Features include:
    • Adjustable follow power and cutoff angle
    • Random eye movements with adjustable frequency and look offset power
    • Both world reflection maps and stylized override reflections available
    • Parallax mapped iris depth
    • Adjustable random pupil dilation
    • Included tool to auto detect required settings to get it working for both Maya and Blender imported models
    There are a few things you need to do to get it functional, but they should be outlined thoroughly in the tutorial on the Github page. The primary requirement is each eye being its own centered mesh.

    I would love to hear if this shader works out well for you, or if you have any trouble getting it implemented. It has been fun to develop.
     
    Eremite, OwlBoy, G1fan and 1 other person like this.
  2. k0nest

    k0nest Member

    Joined:
    Nov 18, 2017
    Messages:
    32
    Likes Received:
    13
    VRChat:
    k0nest
    Hey, thank you for sharing your shader with us! I'll totally take a look and try it! ^^
     
  3. Lhun

    Lhun Member

    Joined:
    Jan 21, 2018
    Messages:
    115
    Likes Received:
    52
    VRChat:
    Lhun
    Hummmm! this is pretty damn cool. I use my own method to convert using mmd4mechanim, I wonder how well this would work with that. Each eye has it's own armature - buta lot of mmd basemeshes use a single material for both eyes, but not always. I could UV myself in meta into two materials. Hummm.

    Is there any chance your shader could/would account for a single 180deg UV mapped material typically used for the face on most models, or would it simply need a material assignment for the eyes part to be seperate?
     
  4. AirGamer

    AirGamer New Member

    Joined:
    Apr 15, 2018
    Messages:
    7
    Likes Received:
    4
    Can this shader be used to add eye tracking to models that lack eye bones?
     
  5. Vilar

    Vilar New Member

    Joined:
    May 9, 2018
    Messages:
    3
    Likes Received:
    4
    VRChat:
    Vilar
    Lhun: I am not quite sure what you mean. The shader rotates geometry exactly as if the geometry was rotated in editor around its pivot. UV mapping is not important except for pupil dialation. Entire meshes can be rotated with this shader. It needs a centered pivot point though, so does not work with skinned eyes that have a pivot at the foot and are weighted to eyebones.

    AirGamer: Yes! As long as the eye geometry is separated and has a centered pivot point, it will work.
     
  6. Ddm5

    Ddm5 Member

    Joined:
    Jan 10, 2018
    Messages:
    49
    Likes Received:
    5
    VRChat:
    Hatsune Miku.
    Handy, it'll come in use for avatars that use much older game models that don't have functioning eyes, been meaning to do something like this for my friend.
     
  7. Feet

    Feet New Member

    Joined:
    May 20, 2018
    Messages:
    2
    Likes Received:
    0
    VRChat:
    Feet
    I'm having an issue, any time I try to use the setup tool for offsets it tells me to remove the armature modifier from my mesh. It has no armature modifier though. What can I do here?
     
  8. OwlBoy

    OwlBoy Member

    Joined:
    Nov 19, 2017
    Messages:
    13
    Likes Received:
    9
    VRChat:
    owlboy
    Thank you for sharing these cool shaders with the community and providing docs and lots of options.
     
    TakUser and k0nest like this.
  9. TakUser

    TakUser New Member

    Joined:
    Apr 4, 2018
    Messages:
    2
    Likes Received:
    0
    VRChat:
    TakUser
    Hey, I gave it a try and it's really good and worked with a character whose design was otherwise incompatible with the Humanoid rigging system. One request for the future though, would it be possible to add a metallic/roughness option? I have a horror-oriented character whose sclera I'm looking to make black. In any updates would it be possible to add this as a feature?
     
  10. Vilar

    Vilar New Member

    Joined:
    May 9, 2018
    Messages:
    3
    Likes Received:
    4
    VRChat:
    Vilar
    That error happens if the eye has a skinned mesh renderer rather than a mesh renderer. The most likely cause is that you have an armature modifier on the eye mesh in blender prior to export. You can simply use the eyeball spheres provided in the example prefab if you like.

    Metallic/Roughness sounds like a good idea. I will try to update it next time I get a chance to work on the package!
     
  11. Feet

    Feet New Member

    Joined:
    May 20, 2018
    Messages:
    2
    Likes Received:
    0
    VRChat:
    Feet
    Just got around to messing with it again. It will show the error if the eyes have shapekeys. Removing them made the objects be imported with a Mesh Renderer.
     
  12. Wintermute

    Wintermute New Member

    Joined:
    Jan 2, 2018
    Messages:
    3
    Likes Received:
    2
    VRChat:
    Wintermute
    Sorry to necro, but I'm wondering is it hard to modify the shader to allow for a "flat lit" or "unlit" look? The smooth shadows clash with illustrated models using other unlit materials so I can't use it with any of my anime style models.