Forum rules - please read before posting.

Custom Highlight

hello, everyone
I'd like to customize the highlight effect, maybe just by illuminating the edges of the mesh and setting the color etc...
Is there a way to do it, maybe calling some action/function that changes the material by passing over the mesh with the mouse? Or any other way that doesn't involve the use of code. I'm working on a First Person Adventure project.

Thank you.

Comments

  • Any kind of custom highlight effect is going to require some custom scripting, because scripting is inherently necessary to trigger material/shader changes.

    AC does try to simplify this somewhat with the Call custom events? checkbox in the Highlight Inspector, which allows you to tell it exactly which custom script functions to call when starting / stopping the Highlight effect.

    What's your render pipeline?

  • hi chris
    I'm using URP

  • edited July 2020

    I did experiment myself with a highlight-outline effect in URP, but given that Unity are still making changes to this system I'm not sure if it'll still be valid.

    Let me take a look and see if I can dig it out.

  • OK, give this a try. I'm afraid I'm no shader expert, and a lot of this code was found on various forums, so this'll be "as is".

    1) Make a new shader graph called Outline and set it up like:

    2) Make two Materials - one that uses the above Outline shader, and another that uses this Hotspot shader:

    https://paste.ofcode.org/bYhPhfZXs3prU4ZNAsNgcu

    3) Make sure that your Hotspot's highlight object is on a separate object to eht Hotspot, and put the Highlight object on a new layer named Outline. Also, give it the new Hotspot material (you'll probably have to make a new Material that uses the Hotspot shader for each such Hotspot)

    4) Uncheck "Auto-brighten materials when enabled?" and attach this "Highlight To Outline" script as a component:

    https://paste.ofcode.org/rHGeGWmidDBzJ6hbxRzKyZ

    (You can tweak the code to have the outline change colour)

    5) Add a Renderer Feature to your Pipeline asset like in this image:

  • Hello there,

    Just wondering if those two pieces of code might still be available somewhere, by chance!
    This is something I'd like to implement, although the links to the code are now broken.

    The effort put in to creating this effect is appreciated, in any case! Thanks so much for the assistance!

  • They may have been lost to time, I'm afraid.

    However, I have since added an integration for Easy Performant Outline to the wiki:

    https://adventure-creator.fandom.com/wiki/Easy_Performant_Outline_integration

    The project that I was originally using the lost code since switched to this method.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.