Crosshair Shader

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Crosshair Shader

Postby Bambo » 2017-11-22 @ 14:50

Hi there!
There are several DOS shooters which would benefit from a "crosshair", even if it's only for psychological reasons for the modern player.
One way to achieve this would be an overlay, but there's no way to run DOSBox in borderless fullscreen mode.

I thought the easiest way to achieve this is using an .fx HLSL shader, which can be used by some DOSBox builds.
Maybe I'm overestimating the effort, but creating a very simple shader that renders a colored pixel in the middle of the screen should be trivially easy for someone who knows a bit about shaders, right?

Anyone here that likes to volunteer or push me in the right direction?
Bambo
Newbie
 
Posts: 14
Joined: 2008-1-18 @ 11:29

Re: Crosshair Shader

Postby Azarien » 2017-11-22 @ 19:50

Bambo wrote:Maybe I'm overestimating the effort, but creating a very simple shader that renders a colored pixel in the middle of the screen should be trivially easy for someone who knows a bit about shaders, right?


I think so. It would be easy in GLSL (ie OpenGL shaders) but I have no knowledge of HLSL unfortunately.
Azarien
Member
 
Posts: 399
Joined: 2015-5-14 @ 07:14

Re: Crosshair Shader

Postby Bambo » 2017-11-23 @ 00:23

From what I think to understand by reading through the code of other .fx effects is that you need a vertex part and a fragment part with the vertex part determining the location(s) and the fragment part what should be done with the color of said location(s) (in this case: make it red, white or yellow).

That said: I don't even know where to begin. My hope was finding an example that can be repurposed, but of course those sharers all try to accomplish something very different and more complicated and I don't really understand those to begin with (the little programming know-how I have is mostly Python)
Bambo
Newbie
 
Posts: 14
Joined: 2008-1-18 @ 11:29


Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 2 guests