Skip to content

Fix road/node texture mismatch on "plain" roads #2

@kianzarrin

Description

@kianzarrin

In the picture bellow 4L road has smooth segment to junction transition but there is a APR texture missmatch for the 6L road.
Screenshot (1)

After doing a few experiments it appears that only plain roads(no aymmetry/decoration/medians) have this problem.

sometimes CS stretches node texture WRT the segment texture before rendering them. In such circumstances blending in the segment texture to node texture can result into texture mismatch.

// Simplified blending code
float weight= i/length; 
node_color[i] = node_color[i]*weight+segment_color[i]*(1-weight);

So far I look for grass/trees in the name of the road to determine if it has decoration and look for a lane with laneType == None to find medians. If so I shrink segment textures by 91%.

Problem

I do not know what exactly to look for (is there a field or a flag I need to check) to distinguish such roads from one another and I do not know how much is the scaling factor.

  • I do not know if the shrinking factor is always a constant 91%.
  • My criteria of searching the road name to determine decoration is hackish and not future proof.
  • Is it really the roads without median/decoration that have texture mismatch?

###Need

  • better criterion for determining road decoration (info.GetDecorationArea() does not work - maybe calculate integral of yellow color in the segment texture?).
  • my criteria of looking for decorations/median seems hackish and not future proof. I need to know what part of code is responsible for this texture mismatch and replicate that code or myself.

Further notes

In the images bellow I put the segment texture underthe generated (by blending) node APR texture for 4L and 6L road:

Screenshot (246) - Copy

node melt_APRMap

related:
#1 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions