[GLSL] Scope Template

Post your example zscripts/ACS scripts/etc here.

[GLSL] Scope Template

Postby Pixel Eater » Tue Apr 24, 2018 12:54 am

An animatable scope for custom weapons. Version 1.2 is higher precision, uses the screen's center for zero coordinates and has aspect corrected 1:1 zoom.

Scope1.2.pk3
(2.55 KiB) Downloaded 94 times
Spoiler: Some possible effects...

There is a test menu to demonstrate each variable's range* and purpose:

*Edit: The menu actually limits some ranges.

S'pose I should add a screenshot...

Something I might add in future is a Tint/Darken/Desaturate type of thing for the unzoomed portion of the screen.

Original version here
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: [GLSL] Scope Template

Postby TiberiumSoul » Sun Mar 24, 2019 1:25 pm

Necrobump from hell and I apologize for it...

but could this be applied as an overlay on a weapon sprite like on the Sniper in Halo 3 for example
User avatar
TiberiumSoul
The Lost Soul that stumbled into a patch of tiberium crystals
 
Joined: 20 Jan 2012
Location: My Computer...
Discord: 2012
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Legacy GZDoom)

Re: [GLSL] Scope Template

Postby Pixel Eater » Sun Mar 24, 2019 4:27 pm

The easiest way is to set the 'target y' property to 0 and lower the 'draw y' property so that it lines up with the sprite.
If instead your sprite is screen centered you'll need to draw a transparent circle of pixels in the sprite to be able to see through it.

Also, mess around with the gldefs file so that it reads either 'hardwareshader postprocess scene' or 'hardwareshader postprocess beforebloom' in order to place the scope in front of or behind the sprite.
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: [GLSL] Scope Template

Postby TiberiumSoul » Tue Mar 26, 2019 6:16 am

Im using an angled sprite with a square LCD Window next to the scope lens is there a way to fuck with the shape too?
User avatar
TiberiumSoul
The Lost Soul that stumbled into a patch of tiberium crystals
 
Joined: 20 Jan 2012
Location: My Computer...
Discord: 2012
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Legacy GZDoom)

Re: [GLSL] Scope Template

Postby Pixel Eater » Wed Mar 27, 2019 12:11 am

Only by modifying the shader, it can't be done from zscript. You'd think it'd be simpler than the circle but today I can't get it to work right. I'll come back to it later though :shrug:
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: [GLSL] Scope Template

Postby TiberiumSoul » Wed Mar 27, 2019 1:27 pm

Okay ill get you a pixel ratio of the LCD its definitely 16:9 widescreen even for being small as all fuck.
User avatar
TiberiumSoul
The Lost Soul that stumbled into a patch of tiberium crystals
 
Joined: 20 Jan 2012
Location: My Computer...
Discord: 2012
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Legacy GZDoom)


Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest