How do i use a slider to adjust Brightness or Contrast?

I need a small line of code that I can adjust the Brightness/Contrast of my game. Make sure it uses a slider from -100 to +100, -100 would mean less brightness or Contrast and +100 would mean more brightness and contrast. Anyway I can approach this?

I tried a quick crack at it. It’s not perfect, but it might be a good starting point for someone who wants to pursue a similar effect… Import the ImageEffects from the StandardAsset. Put this script on the camera and hook up the shader reference.

To work with a slider, place the SetBrightness or SetContrast function in the slider’s OnValueChanged list.

using System;
using UnityEngine;
using UnityStandardAssets.ImageEffects;

[ExecuteInEditMode]
[AddComponentMenu("Image Effects/Custom/Brightness Effect")]
public class BrightnessEffect : ImageEffectBase
{
	[Range(0f, 2f)] public float _Brightness = 1f;	
	[Range(0f, 2f)] public float _Contrast = 1f;

	// Called by camera to apply image effect
	void OnRenderImage (RenderTexture source, RenderTexture destination)
	{   
		material.SetFloat ("_Brightness", _Brightness);
		material.SetFloat ("_Contrast", _Contrast);
        Graphics.Blit (source, destination, material);
	}
	public void SetBrightness(float value)
	{
		_Brightness = value;
	}
	public void SetContrast(float value)
	{
		_Contrast = value;
	}
}

//

Shader "Custom/Brightness Effect" {
Properties {
	_MainTex ("Base (RGB)", 2D) = "white" {}
	_Brightness ("Brightness", float) = 1
	_Contrast ("Contrast", float) = 1
}

SubShader {
	Pass {
		ZTest Always Cull Off ZWrite Off
				
		CGPROGRAM
		#pragma vertex vert_img
		#pragma fragment frag
		#include "UnityCG.cginc"

		uniform sampler2D _MainTex;
		uniform float _Brightness;
		uniform float _Contrast;

		fixed4 frag (v2f_img i) : SV_Target
		{
			fixed4 output = tex2D(_MainTex, i.uv);
			output = output * _Brightness;
			output = (output - 0.5) * _Contrast + 0.5;
			return output;
		}
		ENDCG
	}
}

Fallback off
}

Hey, why not use Colour Grading is Post Processing? Bump up those sliders and you’ll have pretty much the same effect.

You have to do a bit of a research. I will link you to some pages that will help but you have to write the scripts yourself. It’s the best way to understand how things work and learn at the same time. Take a look at the Slider, Slider UI, RenderSettings. Good luck !