Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
avatar
Member [Lv. 3]
Member [Lv. 3]
Posts : 45
Points : 1398
Rep : 3
Join date : 2015-08-30
Age : 23
Location : Melbourne
View user profilehttp://jakeaquilina.weebly.com/

Sniper Scope BO3 Style

on Thu Sep 10, 2015 3:05 am
Hey Guys been working on a project for the past week and a bit and ran into some issues with sniper scopes, though i thought i had combat this problem quite well it seems i ran into another hurdle i need to get over but haven't quite figured it out yet.


target effect

Image of Black ops 3 sniper scope




Image of CS:GO AUG Scope


this is the effect i am after where you can still see both sides of the view i have achieved this by using a secondary camera  and attatching a render texture to it and a cylinder for the scope scaled down for the lens.

a Sniper View


A Rifle View


the biggest issue im having with this is the render texture rendering the scope lens, it flickers and is not accurate when i use mouse scroll wheel to change zoom setting however the way i have the lens set up is on a plane in-front of the scope camera, but this does indeed flicker, would anyone have a better solution to render the reticule/lens (the image that is suppose to be on the scope lens), i am also using layers to render to specific cameras such as the weapon is not rendered to the scope cam but is rendered to the main camera.




this allows me to perfectly always shoot ray casts from the center of my screen, even if the scoped weapons (with the second camera and render texture do not align this still shoots perfectly as expected) however the scope glitch is the biggest issue and the way the lens/reticule/Scope Texture gets applied. this works fine if i lock the zoom variable (FOV) to 5 without adjusting it, but i want players to have full control on how they adjust their scope zooms.


any help with this matter would be greatly appreciated.
Member [Lv. 2]
Member [Lv. 2]
Posts : 5
Points : 996
Rep : 0
Join date : 2015-11-06
View user profile

Re: Sniper Scope BO3 Style

on Fri Nov 06, 2015 6:21 pm
That looks really amazing o:
avatar
Member [Lv. 3]
Member [Lv. 3]
Posts : 45
Points : 1398
Rep : 3
Join date : 2015-08-30
Age : 23
Location : Melbourne
View user profilehttp://jakeaquilina.weebly.com/

Re: Sniper Scope BO3 Style

on Fri Nov 06, 2015 6:42 pm
it works now though Smile no idea what caused it not to. Moved it to a new project and works fine Smile
avatar
Member [Lv. 3]
Member [Lv. 3]
Posts : 28
Points : 1501
Rep : 2
Join date : 2014-10-05
Age : 16
Location : United Kingdom
View user profile

Re: Sniper Scope BO3 Style

on Sat Nov 07, 2015 5:55 am
You could use a DOF script which focuses on the gun, to blur everything but the gun (and hopefully not the render-to-texture).
avatar
Member [Lv. 3]
Member [Lv. 3]
Posts : 45
Points : 1398
Rep : 3
Join date : 2015-08-30
Age : 23
Location : Melbourne
View user profilehttp://jakeaquilina.weebly.com/

Re: Sniper Scope BO3 Style

on Sat Nov 07, 2015 7:05 am
Ahh I might look into it thanks what does DOF stand for, haven't heard that term before?
avatar
Member [Lv. 3]
Member [Lv. 3]
Posts : 28
Points : 1501
Rep : 2
Join date : 2014-10-05
Age : 16
Location : United Kingdom
View user profile

Re: Sniper Scope BO3 Style

on Sun Nov 08, 2015 4:32 am
aquilinajake wrote:Ahh I might look into it thanks what does DOF stand for, haven't heard that term before?
Depth of Field. Unity 5+ comes with it, and you can import it, but if you're using a different version you'll need the Pro edition to get it. It's really easy to use too, and would make for a good addition. Keep in mind that you'll need to attach the DOF script to your scope script and enable/disable it from there, though.
avatar
Member [Lv. 3]
Member [Lv. 3]
Posts : 45
Points : 1398
Rep : 3
Join date : 2015-08-30
Age : 23
Location : Melbourne
View user profilehttp://jakeaquilina.weebly.com/

Re: Sniper Scope BO3 Style

on Sun Nov 08, 2015 5:15 am
Hmmm been having issues usind dof tbh. hasn't worked properly, will have to look into how to use it properly, thanks for that.
Back to top
Permissions in this forum:
You cannot reply to topics in this forum