killkhergit
Squire
Have been experimenting with shaders or a while, and came up with modification of mb.fx(o), which skips geometry after a certain distance from the camera has been reached.
When should I use this mod right now?
1. When you want to improve your framerate.
2. When you're interested in how shaders work.
3. When your graphics card supports the dx9 option of MnB (pixel shaders not needed, but recommended).
Release 1.4
Download --> http://www.mbrepository.com/file.php?id=1573
- Even more optimization
- Made all vertex shaders use LODs
- Simplified options, added english comments
- Set fading to off by default
- Compatibility with the Flora Mod
Release 1.3
- Made all vertex shaders use LODs
- Added even more user friendly options, with dutch comments
- Added an optional fading instead of discrete dissapearing
Release 1.2
- Made most vertex shaders use LODs
- Pixel shaders do cooperate now, no artifacts anymore
- Fixed a few shaders
Release 1.1 beta
- Made most vertex shaders use LODs
- Added more user friendly options
- Pixel shaders do cooperate now, no artifacts anymore
Release 1.0 beta
- Made most vertex shaders use LODs
- First release
- Pixel shaders don't yet cooperate at the moment
How to install:
- Place both 'mb' files (mb.fx/mb.fxo) in a backup.
- Put the new ones including defs.fx when using v1.3 in their place.
- settings can be edited in the top section of mb.fx
When should I use this mod right now?
1. When you want to improve your framerate.
2. When you're interested in how shaders work.
3. When your graphics card supports the dx9 option of MnB (pixel shaders not needed, but recommended).
Release 1.4
Download --> http://www.mbrepository.com/file.php?id=1573
- Even more optimization
- Made all vertex shaders use LODs
- Simplified options, added english comments
- Set fading to off by default
- Compatibility with the Flora Mod
Release 1.3
- Made all vertex shaders use LODs
- Added even more user friendly options, with dutch comments
- Added an optional fading instead of discrete dissapearing
Release 1.2
- Made most vertex shaders use LODs
- Pixel shaders do cooperate now, no artifacts anymore
- Fixed a few shaders
Release 1.1 beta
- Made most vertex shaders use LODs
- Added more user friendly options
- Pixel shaders do cooperate now, no artifacts anymore
Release 1.0 beta
- Made most vertex shaders use LODs
- First release
- Pixel shaders don't yet cooperate at the moment
How to install:
- Place both 'mb' files (mb.fx/mb.fxo) in a backup.
- Put the new ones including defs.fx when using v1.3 in their place.
- settings can be edited in the top section of mb.fx
When a frame needs to be drawn, and in that frame a model needs to be drawn, the CPU tells the graphics card to go render 'that' model on 'that' position in the frame. Take a tree for example. They mostly use a materials called 'trees', this material uses the 'flora' shader. In mb.fx, the CPU will then go looking or a technique called 'technique flora':
technique flora
{
pass P0 // First frame pass
{
compilecommand of the vertex shader
compilecommand of the pixel shader
}
}
Every model which uses 'trees' material gets the 'flora' treatment. All the previous stuff is being put together by the CPU, and sent to the graphics card.
First the vertex shader is called (vs_flora()), and every vertex* is processed by it. When all vertices are passed, most important stuff (like colors, positions, texture coords) are sent back to the technique bit of code. Immediately after, the pixel shader is called. Most important information previously calculated, is sent with it. Then the pixel shader shoots test rays into the scene (the scene is still invisible to the user, if he'd be able to stop progress at this point), and when a ray hits an object, it reads through the sent data, locates the correct textures, positions, colors, and generates a rgb(a) color. This color is outputted. After all pixels** have been sampled, the completed frame is sent to the frame buffer, waiting to be sent to the screen.
This modification calculates the vertex position, and when it exceeds a certain limit, all further vertex calcutions are skipped, and alpha is set to 0.0, making the vertex invisible.
*Every vertex shader (in the graphics card chip) can process one vertex at a time
**Every pixel shader (in the graphics card chip) can process one pixel at a time
***The new DX10 Unified Shaders can process both pixels and vertices. Removing the waiting between the vertex process and the pixel process.
technique flora
{
pass P0 // First frame pass
{
compilecommand of the vertex shader
compilecommand of the pixel shader
}
}
Every model which uses 'trees' material gets the 'flora' treatment. All the previous stuff is being put together by the CPU, and sent to the graphics card.
First the vertex shader is called (vs_flora()), and every vertex* is processed by it. When all vertices are passed, most important stuff (like colors, positions, texture coords) are sent back to the technique bit of code. Immediately after, the pixel shader is called. Most important information previously calculated, is sent with it. Then the pixel shader shoots test rays into the scene (the scene is still invisible to the user, if he'd be able to stop progress at this point), and when a ray hits an object, it reads through the sent data, locates the correct textures, positions, colors, and generates a rgb(a) color. This color is outputted. After all pixels** have been sampled, the completed frame is sent to the frame buffer, waiting to be sent to the screen.
This modification calculates the vertex position, and when it exceeds a certain limit, all further vertex calcutions are skipped, and alpha is set to 0.0, making the vertex invisible.
*Every vertex shader (in the graphics card chip) can process one vertex at a time
**Every pixel shader (in the graphics card chip) can process one pixel at a time
***The new DX10 Unified Shaders can process both pixels and vertices. Removing the waiting between the vertex process and the pixel process.