Jump to content

Grass impostor billboards update


photo

Recommended Posts

Hello,

Updating from 2.6 way up to 2.11 we've encountered several issues with visuals based on grass_impostor_base.basemat:

1)

The most important one was that now billboards are half buried in the ground. By comparing the shaders I can see a difference in the way billboard vertices are positioned vertically, mainly this line (in core\shaders\grass\impostor\vertex\common.h):

vertex.xyz += binormal * ((in_data.texcoord.y - 0.5f) * height);

which, if converted to:

vertex.xyz += binormal * ((in_data.texcoord.y) * height);

produces the same results as 2.6, as this older version has it as:

vertex.xyz -= binormal * (IN_ATTRIBUTE(3).y * height);

Is this a breaking change? How to counter act this, by using the pivot_offset? But this is in world space?

 

2)

New material parameters were added at one point (2.7): phi and theta with default values 8 and 4. Previously you had impostor_transform (4 floats) with default values 8, 2, 0, 0). So second parameter didn't matched.

The update scripts didn't made the change (it just removed impostor_transform parameter without inserting phi and theta), had to manually track the error and update the materials.

 

Kind Regards,

Adrian L.

Link to comment

Hi, ok thank you, will let our content devs use that tool and see if it fixes all issues.

I also noticed that after the world hierarchy xml content was updated, the prefab_id and linked_to_prefab_id attributes are no longer present (as they were present in 2.6 and 2.11 is no longer use those). Are these something I need to worry about?

Link to comment
×
×
  • Create New...