So unlike my previous attempt at this, the info texture is plugged into a fog shader.
It adds a dark fog to the out-of-los areas, and static noise to areas not covered by radar.
So there are two possible ways for this to be done: 1. Through the terrain shader (previous attempt) Pros: - Faster - Better looking effects (like desaturation, hue shifts, etc)
Cons: - Static and hard to modify (because its engine shader, hard to plug new things into it) - only effects terrain
2. Through a depth shader gadget as shown here Pros: - Each mod can easily customize the way it looks - No significant engine code needed - Effects everything (map, grass, water surface, features) - Allows map border fog
Cons: - Slower - limited set of effects (basically a transparent image overlay) - will interact badly with map fog effect
Last edited by Beherith on 20 Apr 2012, 05:29, edited 1 time in total.
Awesome idea! Some kind of visually smooth transition between LOS/Radar/Neither would also be nice. I.e. the unit or radar dot fades in/out. The infotex changes could also be visually smoothened for extra eyecandy.
If it has not been fixed yet the infotex generation is horribly bad. It is very slow and unflexible. It could be optimized to near real time but better yet move the generation to GPU. Should be failry easy. Just do every sensor in it's own texture and if the old type texture is still needed generate it with GPU.
Just for the LOS shader would it be faster or easier when you have multiple and smaller "alpha textures"?
You didn't answer the question. Is it easier to work with multiple 1 bit texture than with the infotexture? It is probably just few lines of code to generate those 1-bit textures. (note the texture are "all" different sizes) Different textures: airLOS LOS Radar Jammer Sonar
If you go engine way, several mods have visual los > radar los so it makes no sense to add noise for areas under visual los even if they miss radar. (Switch)
It seems to go gadget/widget way -> very easy to change.
I did the alpha texture uploading, it is blazing fast and easier than I imagined and works perffectly. old way: 280 FPS -> 47 FPS new way: 280 FPS -> 200 FPS (270FPS with optimized)
Even the texture generating works fine in Lua, only thing I didn't got yet working is blending and interpolating the alpha textures to the Lua infotex.(not necassary if the shader is changed to use the alpha textures)
I have no idea how to set the GL blending operators.
Pako, having 1 texture is very important, as texture lookups are expensive on the gpu side; doing 5 lookups is significantly expensive. Edit: sonar can be merged into radar, as well as jammer (radar-jammer)
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum