I'm working on a level for class and I'm trying to replicate BF3's style, with strong lighting, lens flares, and the dirty lens effect. I've been messing around and so far, my only method of the dirty lens is mapping my material to the lens flare object, so when it's in view, the texture will appear.
However, it doesn't fit to the screen(it's just a texture floating in space basically). My professor recommended I look into a matinee anim, like Epic did with the "Damage_Shake", but they don't seem to work with my PostProcess Chain.
Is there a better way to do this? I'd rather create a material and use it in the PPC or Lens Flare if possible.
Replies
When the player is looking at a strong light, parts of the texture is lit.
I also tried setting up a plane in front of the spawn point and attaching it to the player. That worked, somewhat, but with all of the bouncing UT bots do, it's a little too much. I could see my material when it wasn't being lit. I could also look around and see the edge of the plane.
Doing color and tone adjustments can then be done through the uberpostprocess chain. You can also go to view -> world properties to mess around with the settings on a global level.
Maybe I just need to take a look at my material again. I'll take a look at it and see why it doesn't work well with the unlit post process node. Thanks for your help!
here's my result:
Hey, nice result! You got it to work, it just doesn't react to light? I never tried Additive mode(never knew what it did, just stuck with unlit, phong, masked, translucent). How is your material set up?
I replied just as you posted, so sorry for the double post. I'll give it a look. Hopefully whatever he uses loads with DX9, my laptop doesn't support DX11.
I tried messing with the lens flare actor, but all I could get was a texture that loads in space around the flare. It doesn't appear to be on screen or affected by light, it's just kind of... there. Perhaps I didn't do something right or missed a setting, I'm not really familiar with that part of the editor.
This is the droid you're looking for.
They stay still the whole time,i really doubt those are lens flares,is there any way to lock a lens flare element to a region on screen?
thanks,yes that's the major problem,in other words it's just a static effect,i used the additive mode so i wouldn't have to make a separate mask for the texture for using in translucency mode,since additive mode works like the Screen mode in Photoshop and discards the black color for you,but as far as i know you shouldn't generally use additive for postprocess effects,about the set up,as i said it's just a dirty lens texture(with black background),pluged into a power node to tighten the effect a bit,pluged into the emissive...
Ok,there's a light bulb flickering above my head,but can't quite lighten me up,lol,either you're going to have to explain a bit more or i have to get messing around...how will that help figuring out the location of lights in the scene?...is it possible that a light vector might be involved in this?
Could do a paint over of what you're trying to accomplish? It sound to me that simple Camera PP which as a Phong like mask for a Vignette kind of effect for masking out the 'sweat' in the middle, while lerping between a Distorted SceneTexture with slight Chroma is what you're looking for.
And the Lights would be simple a flat plane, with streaking for opacity, always facing the player and sorting order set to 'top'.
and just so we are on the same page,that IS a PP effect,and not a lens flare system,right?...the texture is still and consistent throughout the whole video,only the portions that show up are different...unless,of course i'm missing something here...
As others have already said there's no need to figure out locations of lights - just place lens flare actors where lights are.
You should look into Lerping the SceneTexture between one that is masked with the 'sweat' effect and one that is 'normal', via said Fresnel.
You could get fancy and use a ScenePosition node with a 'big' sweat texture, so if the player looks around, there is some 'movement' to the sweat.
Again, this is me guessing, so take it with a hint of salt.
I'm not sure about the second one, it would be easy to make it a simple plane with streaks such, but if you want to do it on shader level, I'm guessing you could use the "Flare" nodes? Although I cannot find any documentation about them.
The effect is called Anamorphic Lens Flare, I tried creating it a while back in UDK, but the lack of documentation from GLSL/HLSL communities didn't help me in creating the effect.
Thanks for all of your suggestions! I'm pretty sure Minato is trying to figure out the same thing I am. We're trying to achieve an effect through PostProcess that would replicate the feeling of having dirt on the lens. This method, I'm assuming, could be used for other things like blood and cracks.
Earlier, Minato got it to work, but it doesn't react to light. I'm going for a BF3 style(screenshot above), where the dirt on the lens is only seen when a light is hitting it. Hope this clarifies it a bit.
As for the lens flare actors, I tried that before, but the material is only on the lens flare actor itself. I couldn't get it to look like it was actually on the screen. In this video, he used the lens flare actor and while it looks better than mine, it isn't being affected by the light and the texture is actually just kind of floating there.
[ame="http://www.youtube.com/watch?v=euAL2e-khdE"]BF Flare - YouTube[/ame]
From those Samaritan pics, both are lens flare and Jordan Walker provided example how to make them in Bath Scene files.
As others mentioned, the trick is to use a ScreenPos node for the texture sample which will always fix it to the screen like you're actually using it through a post process, and other part is to use a SphereMask just mask out amount of the texture you want.
This is what I've got back then by 5 min modifying that flare from Bath Scene to get stretched flare look with screen dirt.
Wow, thanks for all of that! I just went through the Bath Scene. I already learned a lot. I'm gonna have to mess with the lens flare actors some more then and fix my material.
@Ace,while i was still pointing to the lens effect in the second picture(didn't even notice the anamorphic effect at the time),the anamorphic is actually another thing that i'm really interested in,that is,making one through PP rather than in a lens flare...btw,when you say an inverted light fresnel you mean the fresnel node inverted or that's a whole other thing?
@Money,ok,now that's what i call a thorough explanation,thank you!...and thanks for pointing out the bathhouse scene,i'm reading the thread right now and it seems like a great resource!...
While i have a few other questions,i'm going to finish looking through the thread first,before asking them just to make sure it isn't actually mentioned in there...
Yeah! I'm interested in a bunch of different effects, so anything you wanna do is cool with me.
Interesting challenge, if you tackle it my good sir!
Yeah, I agree. At the time of the screenshot, the image was tiling too much and was a little too opaque. It's not as cluttered now and it's a lot more transparent, especially around the edges.
[ame="http://www.youtube.com/watch?v=8oWclYuKTk8"]Lens Flare Post Process - Source Shader Editor - YouTube[/ame]
If you want to get complicated with custom HLSL code you can do this or something like it. Basically it scales the image from the center of the screen a few times, with a specified distance between each sample.
Another way, which is what I think Battlefield 3 does, is stores the sprites of the lights, or the lights into a RT or texture, perhaps transparent objects... then uses that.
-But before adding it to the screen it downsamples the texture to 1/2 size, or 1/4 size for performance, then they blur it.
Perhaps the easiest way is to just use the luminance of the image as the flare, then do a simple lerp like I stated above.
Hope this helps? :P
I don't know of a quick way to down-res the buffer before going to the scene texture sample inside of UDK without doing it in code (which I also don't know as well). But I suppose for the sake learning, down-resing isn't a critical step.
Now,for those who are interested in a PostProcess Anamorphic Bloom effect,you can follow this thread over at Epic Forums,it's Dralex's thread about his quest to get it working(which he does),and hopefully he'll let us know a bit more about the process:
http://forums.epicgames.com/threads/782846-My-Anamorphic-Quest
still i am studying the bath scene of jordan walkker to see if i can understand how he used his dusty lens effect affected by light but i can't manage to understand how he does. i found the texture he used on the screen, but when i search fr any material using this texture, it doesn't find any material. how does he apply it to his camera without having any material made with this texture?
-Vignette Mask the screen
-Inner area will have the effect
-Take Luminance of the Scene
-Pow and Mul to have control over Brightness and Contrast values
-Use a Box Blur and blur the texture sideways (left and right only)
-???
-Profit
The only issue is the amount of steps needed for the Blur. You might end up pushing over 10 steps of you want it look good. You could also jitter the effect with a rainbow gradient mask maybe? Since usually streaking lights bleed out the Primary colors at eye value, but not camera value, this effect is especially apparent with hot lights at night when driving.