Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Flickering dover cliff model TEXTURES  (Read 775 times)

0 Members and 1 Guest are viewing this topic.

rogeroger

  • Missioneer
  • member
  • Offline Offline
  • Posts: 295
Flickering dover cliff model TEXTURES
« on: August 11, 2021, 09:37:33 AM »

I have built a large cliff model to replace the Dover cliffs on the 352nd map. I am experiencing texture flickering at a certain position when flying over the model. I initially thought that it might be caused by a part of the model intersecting the terrain, but I placed a copy of the model off the coast and the same flickering happens. The cliff model  on the left side of the harbour is unaffected until I fly over the right side model and then both model textures flicker. The effect is more prevalent in bad weather. I split the edges in blender to nullify blender shading issues, and also tried using bmp files instead of tga for textures. I have created other models and had no similar issues. Any ideas for what may cause this?

Video of issue: https://youtu.be/YzpNxI_NWy0




Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 2891
Re: Flickering dover cliff model TEXTURES
« Reply #1 on: August 11, 2021, 11:19:36 AM »

Objects that flicker at long range, near their point of disappearance, is the result of the farthest LOD model being placed at zero height. This farthest version of an object is often just a rectangle. When a plane surface is placed at ground level, from sufficient distance the game engine can't decide what to give precedence to; said object or the terrain texture beneath. And hence this 'z-plane fighting', as our own Mike has called it, seen as a rapid flickering when the PoV is in motion (if the PoV is rock steady, no flickering.)

The solution is to simply raise the object at least a couple meters; to about the base height of the roof is a good guideline.

I've begun fixing this issue--among others!--for a number of objects. My priority is those objects more commonly used on Pacific maps. In looking over the several thousand objects, I note many issues with "RAF" related objects. Fixing those is a task best divided up among a group of enthusiasts who care to improve the plethora of existing problems.

Now when I fly over, say, Rabaul, no more of this horrible flickering. I plan to shortly release what's been done thus far...
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

rogeroger

  • Missioneer
  • member
  • Offline Offline
  • Posts: 295
Re: Flickering dover cliff model TEXTURES
« Reply #2 on: August 11, 2021, 12:53:17 PM »

Thank you so much for your quick reply to my issue, and for your advice. OK! so it's " z plane fighting". I have encountered this issue in other old games like Starshatter, it's a real immersion killer.

 The cliff model is rather large and is quite a simple model with no extra lods, so it is still looks pretty close when it  pops out of existence at the max lod distance, so hopefully raising it won't look too weird. I will add a distant lod and see how it looks.

I am no experienced modeller so how to go about raising the height? With my pier building models I extruded a translucent verticle polygon from the base of my model downwards to raise my pier buildings to the desired height. Will this work to counter 'z plane fighting", or is there a way I can do this in the msh file?
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 2891
Re: Flickering dover cliff model TEXTURES
« Reply #3 on: August 11, 2021, 02:15:45 PM »

The fact that you get flickering when you have some certainly that there is no 'Z fighting' could render the following of no effect. But try anyway, if this parameter is not active...

In the .mat file, for the farthest LOD, and in the [General] section, add:

  tfDepthOffset 1

This could be tried for other objects like buildings, whose farthest LOD sits in plane with the terrain and flickers. I've not tried this for my fixed objects, mostly because I like the farthest LOD to sit at about roof height.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

rogeroger

  • Missioneer
  • member
  • Offline Offline
  • Posts: 295
Re: Flickering dover cliff model TEXTURES
« Reply #4 on: August 11, 2021, 08:34:52 PM »

Thanks! I will give these a try.  :)
Logged

rogeroger

  • Missioneer
  • member
  • Offline Offline
  • Posts: 295
Re: Flickering dover cliff model TEXTURES
« Reply #5 on: August 12, 2021, 03:15:18 AM »

 Raised the lower lod and added the ' tfDepthOffset 1' line to both base.mat  and skinmid.mat, but unfortunately the problem persists. I'ts worse in bad weather and is also dependent on the sun position. A bit depressing this, I spent a lot of time on these cliffs.

This is an exceptionally large model and I thought  that the same rules would apply regardless of the model size. I have created other models and did not experience this.

Thanks for your time and advice. I did learn something here.
Time for an ice cream binge methinks. :)
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 2891
Re: Flickering dover cliff model TEXTURES
« Reply #6 on: August 12, 2021, 06:57:29 AM »

Out to what distance are you trying to see these cliffs? Could a game engine limitation require that you must scale back on this? Would it be OK to have them appear/disappear at a shorter distance?

It occurs to me that there's a small chance that I may have misread what is the problem. On the off chance that your issue is 'shimmer' due to undersampling a high resolution texture, in the relevant LOD or LODs ensure you have I the .mat file

  tfMipMap 1

This will have the game create a lower resolution texture variation as required, which will be rid of this 'grainy shimmer.'


If this project isn't a state secret  ;)  , would it be possible for me to try it out?

Glenn
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

rogeroger

  • Missioneer
  • member
  • Offline Offline
  • Posts: 295
Re: Flickering dover cliff model TEXTURES
« Reply #7 on: August 12, 2021, 11:17:37 AM »

Hi Glenn
Good name, mine is Glen, the Scots version , I had to do a double take when I saw Glenn at the end of the previous post, like how the hell does he know my name. ;D

The cliff mod is part of my 'WIP' 352nd building object placement submod which you can see herehttps://www.sas1946.com/main/index.php/topic,66206.84.html.

The cliffs process involves using an unlocked Fmb, where I have to lower the height of the terrain cliffs by editing the map_h.tga, first with gimp then with the height tool in the FMB.

Using BLENDER and an unlocked FMB I have created 4 identical sets of cliffs for each side of the harbour placed one on top of the other with three having their manipulators placed out to sea at various angles to extend the draw distances.One cliff model has its manipulator placed just in front of the model so that you see it as you fly over the cliffs. This is the model shown in the video.

I could just put together the cliff models and height map so that you can have a look at it. Things are a bit of a mess at the moment as I have been trying different things to remove the shimmering. When I get my shit together I could pm you a link, though it is part of a bigger mod and I wouldn't want it out there just yet.
Placing the cliffs correctly in the unlocked FMB and adjusting the height and making adjustments in blender has been an extremely time consuming process which has kept me busy for the last two and a half weeks.

The texture is 1024x1024, I could reduce the size, though going too low will not look good.


edit: Still no joy, though there is something that I can try.
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 2891
Re: Flickering dover cliff model TEXTURES
« Reply #8 on: August 12, 2021, 02:20:34 PM »

Glen,
This 'manipulator' thing is a completely new concept to me.

Are you doing things differently to such existing objects as Mount Suribachi? The way you describe it, it would seem so. I gather you have 4 discrete models of a cliff, and not just one mesh with 4 LODs. Intuitively I can see how such an approach could result in odd switching between views if the 'manipulators' are not all co-located. The differing triangles formed by object, 'manipulator' and player viewpoint for each of the 4 models, as I imagine things, could result in 'conflicts' as to which model takes primacy.

Of course, I'm having to apply my imagination to an incompletely understood situation...  ;)

Glenn
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

rogeroger

  • Missioneer
  • member
  • Offline Offline
  • Posts: 295
Re: Flickering dover cliff model TEXTURES
« Reply #9 on: August 13, 2021, 06:40:39 AM »

Glenn,

Just a short explanation for how the manipulator thingy works.

The multi coloured gizmo is the 3d manipulator in blender, usually at the center of the model, but it can be moved away from the model.




This is one of my cliff models, and you can see where I've moved the manipulator.



This is how this action translates in the Fmb.



That icon which I also call the 'manipulator' controls the object movement in the FMB as you would know, and it is usually found at the center of the object.

The sim recognises the 'manipulator' position as the center of the object and the draw distance is calculated from that icon/manipulator and not the 3d model itself.

As I move away from the manipulator towards the object



I reach the draw distance limit and poof!



 I created 3 identical models with the manipulators placed out to sea in various positions so that the cliffs would be visible further out to sea and a manipulator positioned just off center for viewing thecliffs up close. As you move away from the cliffs  one model disappears and another pops up in it's place because its manipulator was placed further out to sea.

I had to  do this because the draw distance limit is the same for all objects, big or small and it is not big enough for such large models. I would probably need a draw distance of 30km for the cliffs, which as far as I'm aware is way beyond the current max draw distance limit.

This works really well for increasing the viewing distance for large objects like harbour models or cliffs.


As far as the flickering is concerned I created a free flight mission in the Fmb to check if the flickering would still be visible and it was'nt.

I originally used a Bat mission to view my cliff model in game and it seems that this mission may have been causing the problem, though I would have to test further. The flickering is still present in that mission. I do not have Bat installed and had to fiddle with the mission to get it to work on my setup. I'll create a similar mission and see whether the flickering re-occurs. This is a video of the recent free flight mission that I created in the FMB. No flickering.

https://youtu.be/sPCmxlB8c8g

I am new to il2 1946 modding and I am sure there is a lot that I don't know. Creating the cliffs model has been and continues to be a fun educational experience, though a bit frustrating at times. ;D I hope that my waffling has made a wee bit of sense.

Glen

Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 2891
Re: Flickering dover cliff model TEXTURES
« Reply #10 on: August 13, 2021, 06:56:04 AM »

Glen,
I was wondering if this manipulator was indeed the model's coordinate system origin (X, Y, Z = 0, 0, 0). Indeed it would appear to be. So your problem here is having no reliable way to switch off one model the instant the other switches on. From some range of viewpoints for any pair of models two will be visible at the same time. BAT will not alleviate this, for its underlying engine is the same.

Glenn
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

rogeroger

  • Missioneer
  • member
  • Offline Offline
  • Posts: 295
Re: Flickering dover cliff model TEXTURES
« Reply #11 on: August 13, 2021, 07:54:35 AM »

Hi Glenn,

Quote
So your problem here is having no reliable way to switch off one model the instant the other switches on.

The one model will switch off automatically as it exceeds the draw distance. If two models co-exist in the same space for a short period it is ok, as long as their mesh does not intersect which causes a different type of flickering or texture shimering.

 My models are of slightly different scales to prevent this from happening.

In the first video only one of my cliff models was present and I intentionally placed a copy out to sea to show that it was not touching the terrain, though it too had flickering textures.


 I know it seems unlikely that a converted mission could cause that flickering, but there were a lot of aircraft in the mission, with action and explosions occurring just offshore from the cliffs and there was a stutter before the flickering started. It could be a graphics issue caused by too many objects and effects rendering at the same time. The fact that it seems worse in cloudy and hazy conditions seems to point to this. I further reduced the cliff texture size to 256x256 which reduced the flickering effect somewhat in that mission.

My 352nd mod also adds a lot of building objects to the game, particularly at Dover.

 With all of my cliff models in place I created a mission with just my aircraft in similar weather conditions, and there was no flickering.


Glen
Logged
Pages: [1]   Go Up
 

Page created in 0.542 seconds with 25 queries.