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.
Joined: 17 Sep 2008, 03:36 Location: your imagination
Wow, I love you so hard right now for making LOS better.
I wouldn't count out #2 so fast if the first one doesn't work on water (that's what it sounds like anyway). Also, what is the difference in performance like?
Pxtl, fixed the images. I would like to ask Kloot and jK about their thoughts on the matter.
Currently I have added $infotex to gl.Texture, and have an additional unsyncedctrl callin that forces the generation of the los texture even if LOS mode is off.
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.
Do #2. I have already overwritten a ridiculous amount of engine behaviour so it may as well be done from the start.
#1 would be good if it works similar to how I want it to and won't randomly stop working in the future. But if you already have #1 there is no harm in including it if it can be disabled easily.
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)
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)
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