Welcome, Guest.
Username: Password: Remember me

TOPIC: Simple Shader that draws a png image onto screen

Simple Shader that draws a png image onto screen 1 year 6 months ago #1

A message to anyone that can help, I am working on a Tank Hud for GTA5, I need to find/ have someone help me get a shader that draws a png image with an alpha over the Final "render' of the game "Last thing loaded because it needs to not be effected by any other shader, I made a Video showing what I mean, the Yellow hud is what I need over top GTA5 Tank HUD Concept
The administrator has disabled public write access.

Simple Shader that draws a png image onto screen 1 year 6 months ago #2

  • Ganossa
  • Ganossa's Avatar
  • Offline
  • 최정장군
  • Posts: 790
  • Thank you received: 838
Can you post that .png?
The administrator has disabled public write access.

Simple Shader that draws a png image onto screen 1 year 6 months ago #3

Here I posted it to my flickr, if you can help Lucifer, that would be a huge step forward.
Tank Hud
The administrator has disabled public write access.

Simple Shader that draws a png image onto screen 1 year 6 months ago #4

  • Ganossa
  • Ganossa's Avatar
  • Offline
  • 최정장군
  • Posts: 790
  • Thank you received: 838
Its very quick and simple as a custom shader with the framework but I will have to find a quiet minute between the Configurator implementation :)
The administrator has disabled public write access.
The following user(s) said Thank You: TrophiHunter

Simple Shader that draws a png image onto screen 1 year 6 months ago #5

Thanks, take your time, im very new to this sort of thing but I feel that Rockstar didnt do the tanks hud justice. I plan on making the hz part on the right grab the frame rate in game, also the cannon's fire how it goes from READY to WAIT, most likely on a timer as its the same every time, I also want to make a compass that displays Rotational Degrees North Being 0', and last a display that show the turret orientation, however im not sure if the tank has a bone that is in line with the turret I can Call for rotation, hope so anyway.
The administrator has disabled public write access.

Simple Shader that draws a png image onto screen 1 year 6 months ago #6

  • Ganossa
  • Ganossa's Avatar
  • Offline
  • 최정장군
  • Posts: 790
  • Thank you received: 838
So this is how it looks with very little code::


This is the code::
NAMESPACE_ENTER(CFX)

#include CFX_SETTINGS_DEF

texture HudTex	< string source = "ReShade/CustomFX/Textures/CFX_hud.png"; > {Width = 2560; Height = 1440; Format = RGBA8;};
sampler	HudColor 	{ Texture = HudTex; };

float4 PS_Hud(float4 vpos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target
{
	float4 hud = tex2D(HudColor, texcoord);
	return lerp(hud,tex2D(RFX_backbufferColor, texcoord),min(1,2.25f*pow(abs(hud.r+hud.b+hud.g)/3f,50)));
}

technique Hud_Tech <bool enabled = RFX_Start_Enabled; int toggle = RFX_ToggleKey; >
{
	pass HudPass
	{
		VertexShader = RFX_VS_PostProcess;
		PixelShader = PS_Hud;
	}
}

#include CFX_SETTINGS_UNDEF

NAMESPACE_LEAVE()
Create a Hud.h file in /ReShade/CustomFX with that code.
Then open ReShade.fx and add after...
#include EFFECT(CustomFX, Gr8mmFilm)
...the new line...
#include EFFECT(CustomFX, Hud)

I have no photoshop anymore and you alpha is blowing up the .png to 14MB which is way to huge. Therefore, I dropped the alpha and used this .png instead::

It is only 62KB big. Drop it as CFX_hud.png in your /ReShade/CustomFX/Textures folder.

After that you should be able to run the game with that hud :) Its only a few lines so if you can create a smaller .png with alpha it should be easy to adjust :side:
The administrator has disabled public write access.
The following user(s) said Thank You: SLAMNDAN, Ederer

Simple Shader that draws a png image onto screen 1 year 6 months ago #7

Wow thank you so much, I can easily use compression, the one I gave was uncompressed, if I compress then I should be ok. thanks again
The administrator has disabled public write access.

Simple Shader that draws a png image onto screen 1 year 6 months ago #8

  • Ganossa
  • Ganossa's Avatar
  • Offline
  • 최정장군
  • Posts: 790
  • Thank you received: 838
Can you post that compressed .png, you would need to change a little line in that code :side:
The administrator has disabled public write access.

Simple Shader that draws a png image onto screen 1 year 6 months ago #9

Ok just let me know what line of code to change
The administrator has disabled public write access.

Simple Shader that draws a png image onto screen 1 year 6 months ago #10

  • Ganossa
  • Ganossa's Avatar
  • Offline
  • 최정장군
  • Posts: 790
  • Thank you received: 838
To use alpha, change
return lerp(hud,tex2D(RFX_backbufferColor, texcoord),min(1,2.25f*pow(abs(hud.r+hud.b+hud.g)/3f,50)));
to
return lerp(tex2D(RFX_backbufferColor, texcoord),hud,hud.a);

It is much more accurate but make sure to compress that huge .png file :lol:
Last Edit: 1 year 6 months ago by Ganossa.
The administrator has disabled public write access.
The following user(s) said Thank You: SLAMNDAN

Simple Shader that draws a png image onto screen 1 year 6 months ago #11

Here's what I got so far, no post production Tank HUD Beta
The administrator has disabled public write access.