Jump to content
Official BF Editor Forums


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Bad_santa12345's Achievements


Newbie (1/14)



  1. are you still around ?

    1. Catbox


      Yes, been super busy at work. How have you been?   

    2. kano


      busy too working on new m8!


  2. 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.
  3. I did some work on this and released a new dll on GitHub. https://github.com/BadSanta12345/RFX/releases/tag/0.02 Exposed more hudItems functions to con scripts. hudItems.getBool std::string -> bool hudItems.getInt std::string -> int hudItems.getFloat std::string -> float hudItems.getString std::string -> std::string hudItems.setInt std::string int -> void hudItems.createBool std::string -> void hudItems.createInt std::string -> void hudItems.createFloat std::string -> void hudItems.createString std::string -> void Exposed functions for manipulating shader uniform variables from con scripts. shadermanager.setFloatBySemantic std::string std::string float -> std::string shadermanager.setFloat2BySemantic std::string std::string D3DXVECTOR2 -> std::string shadermanager.setFloat3BySemantic std::string std::string D3DXVECTOR3 -> std::string shadermanager.setFloat4BySemantic std::string std::string D3DXVECTOR4 -> std::string For the shaderManager functions the first argument is the shader file name, second is the semantic and third is the new value. It only works for shaders which are not conditionally compiled / cached in the profile folder. The commands should work from any .con/.tweak file or from hud buttons etc.
  4. Only thing modified in the RFX.exe compared to vBF2.exe is the import address table so that the first thing it does is load the RFX.dll. The IAT modification can be done to any .exe. I used CFF Explorer to do it.
  5. Ah I forgot that one it should be on there now. You might still need some Microsoft Visual C++ runtimes. I will have to check which ones are actually required and upload a copy of those as well.
  6. https://github.com/BadSanta12345/RFX/releases/tag/Test here are the build binaries for testing that the code even runs. You should copy both RFX.exe and RFX.dll to your BF2 install directory. Then if you run RFX.exe with shortcut parameters "+fullscreen 0" and "+szx 1920 +szy 1080" (adjust to your resolution). Then you should be able to toggle fullscreen with Alt+Enter. Thats pretty much the only feature this version has.
  7. Here is a bare bones version of the source code https://github.com/BadSanta12345/RFX It doesn't have any actual features yet but at least I got it to GitHub so it should be faster to add them in. I do have the code for all the stuff presented in my YouTube videos and for the shader variable thing but I have to do some cleaning up before I am ready to add them to the GitHub project for everyone to see.
  8. Just a little update: I have been working on making the code more portable so if someone else wants to compile it they have to download as few libraries as possible. Now I got it to the point where the only needed library is actually the directx9 sdk which is a must for the shader functionality to work. Also it has to be compiled with Visual studio 2015 because it uses some of the new fancy C++ 11/14 features. I still have to find out why the game always crashes when exiting instead of shutting down and freeing resources correctly.
  9. Yeah. I think the terrain is rendered in 6 passes or so, one for each detail texture. At the moment the system can only pass sort of global data. For example if you pass a texture to a custom texture variable in the bundledmesh shader the texture will be the same for all bundledmesh instances. I think I can make it more clever so that it could pass different textures for different terrain detail layers. PS. I am currently doing some work on the dynamic shadow maps. I already got rid of the horrible shimmering edge when you move or rotate the camera. I think it might be possible to do cascaded shadow maps in BF2. Cascaded shadow maps is the method most modern game engines use for dynamic shadowing.
  10. Textures and samplers work just like any other variable. You can add new or use existing ones. When using existing ones there is a change that BF2 overrides your changes. I don't have the system hooked into BF2's texture manager so there are some differences to regular textures. Textures are loaded on demand instead of deferred loading. Textures don't have to/can't be inside .zip files. Texture path must contain the mods/[modname] because the path is relative to the working directory of BF2.exe instead of the mod directory Textures are unloaded only when BF2.exe is shut down
  11. No you still need the .exe and .dll hack. I also got custom textures working. I just joined Github and started working on cleaned up open source version of the .dll so all my work doesn't go to waste.
  12. I got it working I even exposed the functionality to the .con files so it is easier to experiment. I only added support for float vectors for now. shadermanager.setShaderFloatBySemantic [ShaderName] [ParameterSemantic] [float] shadermanager.setShaderFloat2BySemantic [ShaderName] [ParameterSemantic] [D3DXVECTOR2] shadermanager.setShaderFloat3BySemantic [ShaderName] [ParameterSemantic] [D3DXVECTOR3] shadermanager.setShaderFloat4BySemantic [ShaderName] [ParameterSemantic] [D3DXVECTOR4] For example to pass the sun direction to the terrain shader you could add this to the sky.con or almost any other .con file. var v_sundirection lightManager.sunDirection -> v_sundirection shadermanager.setShaderFloat3BySemantic TerrainShader.fx SUNDIRECTION v_sundirection You can change any parameter but most of those will be overridden by the game so it is better to just add new parameters with different names. This works for shaders where the first line looks something like this #line 2 "TerrainShader.fx"
  13. With my .exe .dll hack it is certainly possible to pass any information to the shaders but in this case it would require a bit of work. BF2 uses the ID3DXEffect interface for managing the shaders so if you could somehow get a pointer to the right effect interface. You could use functions like GetParameterBySemantic and SetFloat, SetFloatArray... to pass any info to the shaders even textures. The problem is how to get the pointer to the terrain shader effect interface. BF2 also uses quite old version of the DX9SDK which may cause some trouble with the interface. I might look into this when I have some spare time
  14. I don't think it is possible with python or with any build in command. I do know a way to change the geom or lod of any object at runtime but as most of my experiments it requires modifying the actual game code (.exe) Proof of concept video https://youtu.be/X3F-9HCbly0
  15. I haven't tested this but instead of an emitter and particle you could use an ObjectSpawner to spawn the sinking ship as a PCO.
  • Create New...