• Announcements

    • Detrux

      Site Relaunched   10/13/2016

      Welcome back to BFEditor.org! We've upgraded the forum software, removed the spammers, and improved security. Apologies for the downtime! Det
Coronaextra

Corona's Shaders

65 posts in this topic

On 27.9.2017 at 7:21 PM, B4rr3l said:

what kind of language I should learn to try to help with this?

 

C++ and Directx9 APIs

On 27.9.2017 at 7:21 PM, B4rr3l said:

- Option to skip 1P layer to apply post processing effects, that would bring MXAO+ and latest DOF support and also, volumetric clouds and lights as post-processing, even real time weather could be implemented... BF2 has Full Z-Buffer support, all those latest Reshade /ENB features could work if we skip the 1P layer and apply the post processing to the scene.

 

I think this could be achieved quite easily with the hooked Directx9 interfaces of RFX.dll. IIRC I already have some custom rendering done just before the 1p scene is rendered. I will look into it when I have spare time.

Share this post


Link to post
Share on other sites
On 03/10/2017 at 6:43 AM, Bad_santa12345 said:

C++ and Directx9 APIs

I think this could be achieved quite easily with the hooked Directx9 interfaces of RFX.dll. IIRC I already have some custom rendering done just before the 1p scene is rendered. I will look into it when I have spare time.

thanks for the Reply Santa, I'm null into that part but I'm doing everything else I can to improve this great game, That's great news! I've tried to ask Crosire and Boris for an updated BF2 blank version to use with latest Reshade that reads the read depth buffer correctly (skipping the 1P) without success. Latest DOF and MXAO+ from ReShade 3.0.8 are awesome and the interface is also neat. It also has a lot of cool effects ready to use as SMAA, Godrays, LumaSharpen, etc, so we don't need to loose time re-creating those, and I can also focus on some weather post processing effects.

And this will also mean the possibility to bring VR to BF2 which fully supports it (even better than BF4), only need an option to skip the 1P and apply the depth based effects straight to the game layer.

 

I'm generating new HD Os maps for a lot of stuff and those addition would bring a nice result.

Also when you do have some time take a look at this, I really thing is possible to adapt coronas shaders to read the terrain alpha as a displacement map instead of a bump map/ parallax.

So that could bring real 3d geometry from the alpha channel, what I do know, is that GPU based Tesselation feature is supported in DX9.0C and in BF2, as that is how terrain is generated.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb219748%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

Analogue to texture, straight processed by the vertex pipeline, GPU

And it also can be stored as BMP or as I said, in a single Channel (alpha)

"A displacement map sampler has behavior identical to that of the pixel texture samplers. If a texture with less than four channels (like R32f) is looked up, the looked-up values go to the appropriate channels of the destination register (the vertex shader input register tagged with the _sample semantic), while the other channels default to (1, 1, 1). When looked up, D3DFMT_L8 gets broadcast into the R, G, B channels and A defaults to 1. The reference rasterizer has the full implementation details."


"Texture coordinates are computed as: U = (Index % TextureWidthInPixeles) / (float)(TextureWidthInPixeles) V = (Index / TextureWidthInPixeles) / (float)(TextureHeightInPixeles) where Index is a sequential index of generated vertices plus TSS[D3DSAMP_DMAPOFFSET]. The sequential index is set to zero at the start of each primitive and is increased after a vertex is generated. "


"When D3DSAMP_MIPFILTER in the displacement map sampler is not D3DTEXF_NONE, the level of detail is computed as follows (Note that the adaptive tessellation state is used even if the D3DRS_ENABLEADAPTIVETESSELLATION is FALSE): Tmax = render state D3DRS_MAXTESSELLATIONLEVEL
Compute tessellation level Te for a vertex Vi: (Xi, Yi, Zi) the same way as described in the "Adaptive tessellation" section. Level of detail L = log2(Tmax) - log2 (Te)."

https://msdn.microsoft.com/en-us/library/windows/desktop/hh706330(v=vs.85).aspx


Tessellation (Direct3D 9)
Tessellator Unit

The tessellator unit has been enhanced. You can now use it to:

    Perform adaptive tessellation of all higher-order primitives.
    Look up per-vertex displacement values from a displacement map and pass them on to a vertex shader.
    

https://msdn.microsoft.com/en-us/library/windows/desktop/bb206188(v=vs.85).aspx

 

Edited by B4rr3l

Share this post


Link to post
Share on other sites

Nice to see that this thread is still active!

Even though tessellation and all those other fancy effects are awesome, I think the terrain normals are the most important feature that needs to be focused on, in my opinion. The terrain in BF2 has always been the weak area of the overall graphics. It has the lowest texture quality, lowest resolution lightmaps and then also the lack of normals or any form of bumpmapping. The reason why I think terrain normals should be the focus, is because to have consistent graphics is much better and makes more sense. Consistency is key here. It would be good to play around with other features as well, but I think we all don't want to make BF2 into BF3 here.

Another thing that is pulling my attention is the fact that the dynamic shadows are very pixelated at times. And don't get me started on the lack of shadow-casting from vegetation since the latest patch. I am still trying to get my head around why DICE would break that feature...

Share this post


Link to post
Share on other sites
11 hours ago, TheObscure said:

Nice to see that this thread is still active!

Even though tessellation and all those other fancy effects are awesome, I think the terrain normals are the most important feature that needs to be focused on, in my opinion. The terrain in BF2 has always been the weak area of the overall graphics. It has the lowest texture quality, lowest resolution lightmaps and then also the lack of normals or any form of bumpmapping. The reason why I think terrain normals should be the focus, is because to have consistent graphics is much better and makes more sense. Consistency is key here. It would be good to play around with other features as well, but I think we all don't want to make BF2 into BF3 here.

Another thing that is pulling my attention is the fact that the dynamic shadows are very pixelated at times. And don't get me started on the lack of shadow-casting from vegetation since the latest patch. I am still trying to get my head around why DICE would break that feature...

terrain normals are already working m8.  We could explore a whole new world with the 1P layer skipped and Reshade 3.0.8 Full support, even True VR could be used. just need some dll to attach with Reshade, a pity I'm so zero left on this.

 

Bf3 was long time gone m8 lol :)

 

nothing would improve more the terrain than the displacement map in the terrain details alpha channel and I suppose it could be easy when using the same structure that corona did on his shaders but with the Tesselation/Displacement instructions.

Edited by B4rr3l

Share this post


Link to post
Share on other sites
On 8-10-2017 at 6:49 PM, TheObscure said:

Nice to see that this thread is still active!

Even though tessellation and all those other fancy effects are awesome, I think the terrain normals are the most important feature that needs to be focused on, in my opinion. The terrain in BF2 has always been the weak area of the overall graphics. It has the lowest texture quality, lowest resolution lightmaps and then also the lack of normals or any form of bumpmapping. The reason why I think terrain normals should be the focus, is because to have consistent graphics is much better and makes more sense. Consistency is key here. It would be good to play around with other features as well, but I think we all don't want to make BF2 into BF3 here.

Another thing that is pulling my attention is the fact that the dynamic shadows are very pixelated at times. And don't get me started on the lack of shadow-casting from vegetation since the latest patch. I am still trying to get my head around why DICE would break that feature...

I tried out your normal shaders and I have to agree that without any control over it through LightManager it's not really worth it. Terrain rindeed really lacks detail in BF2.

 

Personally looking into why Parallax mapping is working in the editor but not in-game right now. Shaders is not my cup of tea though so if anyone has a clue where to start would be much appreciated :P. I believe enabling this could allow for some simple parallax textures to be added to mods which adds just that extra bit of detail that normal maps don't really show. The parallax effect is pretty crap but if you blur it enough and don't use straight edges the results work alright in my opinion.

JMh8c3Y.png

editor:

UCBxtJE.jpg

ingame:

lIs9igF.jpg

 

Share this post


Link to post
Share on other sites

Why would you use such an old technique if you can use much newer stuff as Object space raytraced normal maps, ambient occlusion, specular and everything else? or even tangent space normal maps? those are all supported on statics right out of the box...

 

I will take my hat off for the first one who puts the tesselation to work! specially in the terrain, that would be awesome...

 

Share this post


Link to post
Share on other sites

Just a question. Is the terrain shader implementation something that all modders can use in their projects, or just for PR and perhaps other mods like NaW?

I am really interested to implement it in my mod, since my mod is based on HD content overall and I already have some bump maps created for the vanilla terrain textures. All I need now is the shader and any other files to make it work.

I hope I can also be allowed to use it in my project with the necessary permission of course.

http://www.moddb.com/mods/battlefield-2-unlimited-action

Share this post


Link to post
Share on other sites

Corona is open to anyone adding his terrain shader 's to their personal or public mod, as long as you credit him of coarse!

Edited by kano

Share this post


Link to post
Share on other sites
On 10/15/2017 at 6:11 PM, kano said:

Corona is open to anyone adding his terrain shader 's to their personal or public mod, as long as you credit him of coarse!

Glad to know! I appreciate it when modders share their works. At the end it is for the betterment of the entire community and not for the modder who makes the mod. Back in the day when I worked on Alpha Project, Jones and I benefited from this approach. Even now with my own mod that is the case. Let's keep up the collaboration.

Back to the topic. This addon is in my opinion one of the best, even if it doesn't make the graphics 10 times better. What I like about this addon is that it makes the game much more consistent with regards to the graphical fidelity. Quality over quantity I always say. Can't wait to implement it in my mod. It will really add that extra layer of icing on the cake, especially when coupled with the native HDR feature of BF2 and some view distance tweaks:

http://media.moddb.com/images/mods/1/29/28410/3.1.jpg

http://media.moddb.com/images/mods/1/29/28410/4.1.jpg

I wonder what else is possible with shaders that can make the graphics either more consistent or better. I guess time will tell, but for now I want to thank all of you who made this piece of work possible! :)

 

 

 

Share this post


Link to post
Share on other sites

the biggest problem we have is we ran out of memory for naw to use,

what we need is the bf2.exe to be recompiled for use with 64 bit so the 4 gig memory is no longer a wall for us modders!

Share this post


Link to post
Share on other sites

I Agree Kano but I think that's a much harder one without the source code than try to squeeze newer techniques from the existing shaders, or better, newer shaders for the availables technologies back in time..

But What Boris managed to make for Oblivion is a shader that handles all the game graphics dispatches (or something like that) and then it feeds the game engine pipeline managing the memory in a 64-bit work space. they are both DX9C worth a look, it's called ENB memory boost.

When we got this all ready probably we can just jump to a newer engine and continue from that on, probably unity, dagor or outera, but I've saw some amazing news on linux Vulkan side also. I will probably just jump into linux and never look back very soon.

Share this post


Link to post
Share on other sites
On 03/10/2017 at 6:43 AM, Bad_santa12345 said:

C++ and Directx9 APIs

I think this could be achieved quite easily with the hooked Directx9 interfaces of RFX.dll. IIRC I already have some custom rendering done just before the 1p scene is rendered. I will look into it when I have spare time.

Hey bad Santa any new on some integration with Reshade 3.0.8 skipping 1P overlay? I would love to try the latest MXAO and DOF techniques.

Share this post


Link to post
Share on other sites

Hello everyone hope you are all good.

Brilliant read of the thread this is world class.

Corona may we request permission to use the Great Terrain Normals mod in our project? Apparently from reading earlier posts the Terrain Normals are now working? The screenshots look absolutely brilliant.

Here is the Moddb link to our project.

http://www.moddb.com/members/john007

Eternally grateful for the world class input from the great minds Corona and Badsanta! I salute you.

Thankyou very much for your time and hope to speak soon.

John.

Share this post


Link to post
Share on other sites
On 12/11/2017 at 1:13 PM, JOHN007 said:

Hello everyone hope you are all good.

Brilliant read of the thread this is world class.

Corona may we request permission to use the Great Terrain Normals mod in our project? Apparently from reading earlier posts the Terrain Normals are now working? The screenshots look absolutely brilliant.

Here is the Moddb link to our project.

http://www.moddb.com/members/john007

Eternally grateful for the world class input from the great minds Corona and Badsanta! I salute you.

Thankyou very much for your time and hope to speak soon.

John.

Are you Jones from AP? That is a well frequented thread.

 

I have bad news about the terrain normals that made me remove it from the mod, unfortunately it just work when you set it to high terrain quality, medium and low gives error message :(

they also remove lot's of the texture details so not every terrain gets good with it, like grass will sux. They also don't seem to work in the mos important one which is the rocks when they are using the 2 planes tiling method. which is the best for rocks. They also don't work on the Low detail texture which would probably help even more from long distances.

 

If you are Jones from AP indeed  (lol) can you help me on those amazing zoom shader scopes?  would they also work in U wide resolutions?

Edited by B4rr3l

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now