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. Dismiss Notice

Question Brightening a 2d image

Discussion in 'Scripting' started by JimWebs, Sep 14, 2023.

  1. JimWebs

    JimWebs

    Joined:
    Aug 2, 2023
    Posts:
    44
    Is there a simple way to brighten a 2d image in script? I want an image to be brighter when I hover over it, brighter than the maximum which is set in colours. I tried adding my own diffuse material and adjusting the hdr which works but the original raw image becomes too dark whenever I attach the material and then adjusting the intensity just washes it out, distorting it.
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,955
    could try unlit material, with hdr emission field, using that same texture as emission texture.
    (although might need a custom shader for that),
     
  3. JimWebs

    JimWebs

    Joined:
    Aug 2, 2023
    Posts:
    44
    Thanks, yes that kind of works. I managed to get the hdr now working to brighten it from original image but have another problem -typically :) - which is that it is black in the game view, only visible in scene. Been fiddling the knobs since :)
     
    mgear likes this.
  4. JimWebs

    JimWebs

    Joined:
    Aug 2, 2023
    Posts:
    44
    Well I've got it viewable in the game view but now it's pink in the scene view, haha.