M45 reticle blocks rendering of particle effects & sometimes actors (on net client)

Issue #453 resolved
Colin Basnett created an issue

I don't think there is a way to fix this with the current scheme (optic on the model itself).

My suggestion is to perhaps create an overlay like we do with the tank optics, that way it's not being rendered as part of the level and not subject to this rendering bug. Feel free to brainstorm ways to fix this.

Comments (3)

  1. Matt Hands

    I've 'sort of' got this to work, adjusting the texture settings. But will check properly tomorrow. Currently tracers and effects are showing fine, but only the orange illuminated circles are displaying, not the background glass. Better than currently though.

    I tried it first with just an alpha texture on the sights (DH_VehiclesGE_tex2.ext_vehicles.Alpha) and that didn't obscure anything. Makes me suspect there is a solution.

    The idea of an overlay as a backup plan is a really good one. I've thought out how that would work - we'd switch to an 'interior' mesh for the reflector sight position (without the sight texture) and switch back to the normal 'exterior' mesh in the raised head position (so the sights would show). And in the sights position we'd render the reflector sight as the MGOverlay. State ViewTransition would need a small alteration so it only switches to the int mesh after the 'in' transition, instead of as soon as the transition starts. The biggest problem would probably be getting the sight to be in the right position to look like it's attached to the turret above, across a range of screen resolutions and aspect ratios.

  2. Matt Hands

    Fixed in commit e694983.

    Added a shader material for the sights, with an opacity mask (used existing mask texture).

    Have been able to compress the sight main (diffuse) texture to DTX1 & removed alpha and masking settings on diffuse & mask textures. The shader now handles that. I experimented with reducing texture sizes from 512x512 to 256x256, but it's not worth it due to bluriness appearing the the sight circles (it is viewed very close up).

    I've re-made the sights part of the animation mesh to give a smoother, more rounded shape, & re-mapped the UV in that area. The reticule still centred correctly.

    WARNING: inexplicable weirdness follows !!

    The shader worked fine in SP, but in MP some objects were being rendered in front of the sights. These were closer vehicles and some bits of world geometry, including the big hangar buildings on TR map. Looked totally wrong.

    By happy, random chance I paradropped myself on the M45, using the admin menu mutator, to relocate in front of the enemy hangar and test shooting up vehicles. And I noticed that whenever I did that it somehow fixed the rendering problem.

    Checked what admen mutator does when paradropping a vehicle and it just sets the vehicle base's physics to none, sets the new drop Location, then resets physics back to karma. The physics change is just to get the vehicle to start dropping, otherwise it sits in the sky.

    I tried debug execs to do the same while manning the M45. One to set physics to karma (no change) and one to set location to current location (again not change). Both worked fine, immediately curing the sight rendering problem ! Some kind of setup/reset happens. But if I caused the M45 to re-spawn on the net client, e.g. switched sides, the problem was back, so any fix needs to happen each time the gun spawns.

    Experimenting further, the cleanest, most minimal workaround is for a net client to call SetLocation(Location) on the vehicle base, but only from the weapon pawn class at the point we know the client has received the VehicleBase and MG actors (in InitializeMG function). I have tried this many times and it seems to work reliably.

    One of the weird, pretty random things. I suspect we will probably never know what is going on there.

    ps - I'm going to ask Peter for the original, uncompressed targa for the sight mask texture, in case a less compressed version of that will avoid the need for the code workaround. Someone else must have set up the M45 textures so I don't have the original files.

  3. Log in to comment