Jump to content
Official BF Editor Forums

Blur Ironsights


rhysm_08
 Share

Recommended Posts

Hello, i have recently been experimenting with ironsighting bf2 weapons and animations and stuff. I have succesfully got M4 ironsights working (3d! and 2d!). I like the 3d ironsights because it looks cooler but the 2d ones look better because of the blurtexture. I reckon a blur effect added to the Ironsights could make it look way better than the 2d texture. Unfortunetly i do not know how i could do this. I have come up with two possible solutions (if there are more please say so!).

1) Create an image in photoshop and apply some sort of mask to make the ironsights blurtexture only the blur. Apply it to the lod1 and make it so the object zooms into lod 1.

2) some sort of tricky shader work, which i have no idea how to edit ect... to create a blur effect when zoomed in. 

I'm hoping this is possible in bf2. I hope 3d ironsights can be able to look goo

Thank you for reading.

Edited by rhysm_08
Link to comment
Share on other sites

Yeah, you can have a different post-processing shader for negative values. Like so:

float interference : INTERFERENCE;
PS2FB_Combine ps_TVEffect20(VS2PS_Quad3 indata) {
   if ( interference >= 0 ) {
       code for normal tv effect
   } else {
       code for blur shader
   }
}

etc etc...

Then, the TV effect will just be normal if it's a positive number for interference, and you can set up a weapon to use the blur shader in the weapon tweaks by using a negative value, like so:

ObjectTemplate.postProcess.tvInterference -0.02

To use the value in the shader, you'd just do -interference to put it back to the positive number of course.

You could probably use this method to have a bunch of different post-processing shaders, but I'm not sure how to get more than 64 instruction slots...

Link to comment
Share on other sites

Never thought of that actually.

Well, you can get more instruction slots by changing the pixel shader compile target to ps_2_x - though for crappy old cards it won't be an option because they can only simulate it with software rather than having native hardware support (read: slow on cards that scrape in the minimum BF2 requirements). Still, it gives you at LEAST 96 instructions (and usually more, depending on the card).

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...