Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Videocamera Mirrors Flipped #3153

Open
graysonk95 opened this issue Apr 22, 2024 · 7 comments
Open

Videocamera Mirrors Flipped #3153

graysonk95 opened this issue Apr 22, 2024 · 7 comments
Labels

Comments

@graysonk95
Copy link

I installed 2022.12 and noticed a potential bug with videocamera mirrors versus older versions. The mirrors are flipped horizontally in-game on any of my mods created in Blender and using Videocamera Mirrors. I've been away from the community for some years so maybe I've missed something, but I'm thinking this is a game bug versus a problem with my models.
Both my Thomas HDX and Freightliner FLA have this problem with mirrors, but they worked correctly in 0.38 and 0.4 versions of RoR.

I'm worried if I flip the texture on my model to fix the mirrors in 2022+, the mirrors will be wrong in <0.4. See screenshots.

0.4.0.7
image

2022.12
image

@ohlidalp
Copy link
Member

@graysonk95 Great to see you around again!

Sorry about the response lag, I've been drowned in daily job lately.

Might easily be a bug, a lot went on with the materials and camera setup between 0.4x and now. I'll investigate, but no earlier than next weekend; in the meantime you can try mounting the basic left/right mirrors and see if the distortion remains.

@CuriousMike56
Copy link
Member

The last version without this bug is 0.4.7.0, appears to have been introduced in early 0.4.8 RC builds. Possible solutions:

  • Flip texture back to how it was in 0.4.7.0. This may affect newer mods.
  • Add a new videocamera option to flip the texture on the affected mods.

@ohlidalp
Copy link
Member

ohlidalp commented Mar 4, 2025

In addition to this, the classic mirror props are also broken, it becomes obvious when you flip the vehicle on a side.
Image
I'm analyzing the code of both to figure something out.

@ohlidalp
Copy link
Member

ohlidalp commented Mar 4, 2025

I looked in v0.4.0.7 source and the code which should flip it remained unchanged:

// this is a mirror, flip the image left<>right to have a mirror and not a cameraimage
if (def->camera_role == 1)
vcam.vcam_material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureUScale(-1);

@paroj Is it possible the TextureUnitState::setTextureUScale() was broken? May it interfere with material cloning, texture switching or RTT?

@paroj
Copy link
Contributor

paroj commented Mar 4, 2025

try any other value there and see whether it makes a difference..

@ohlidalp
Copy link
Member

ohlidalp commented Mar 5, 2025

@paroj Tried both positive and negative values, turns out OGRE works perfectly.

@graysonk95 I found the problem: both OGRE and RoR work as expected, but your mirror meshes have pre-flipped UVs because there used to be a bug somewhere. Screenshot from Blender:

Image

Well, I'll add an option to unflip the mirror to the TopMenubar/Tuning menu.

@CuriousMike56
Copy link
Member

CuriousMike56 commented Mar 6, 2025

The Mitsubishi Pajero also had flipped mirror UVs (fixed with update 1.3.1):

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants