How is it possible to set mainTextureScale on the lwrp lit shader ( Tiling )

I was able to do smth like this to strech an material with standartShader in the standart render pipeline.

Renderer renderer = getComponent<Renderer>();
renderer.material.mainTextureScale = new Vector2(5,1);

but doing so with the lit shader in lwrp nothing happens.

tried it with the following, but i guess “Tiling” is not the Right Propety name. Inside the lit shader i couldnt find the Right Property by lookig at it.

MaterialPropertyBlock block = new MaterialPropertyBlock();
block.SetVector("Tiling",new Vector4(5,1,0,0));

Did you find any solution?

use mat.SetTexture(“_BaseMap”, texture);

block.SetVector( “_BaseMap_ST”,new Vector4(1.0f, 1.0f, 0.0f, 0.0);

these are set per material
if you do instance rendering you have to adjust the shader to set tiling for different instances

I have this problem too, did you get it to work?

EDIT:

This works, for anyone completely new this is the full code I used:

  Material m = gridPlane.GetComponent<MeshRenderer>().material;
        MaterialPropertyBlock mblock = new MaterialPropertyBlock();
      
        mblock.SetVector("_BaseMap_ST", new Vector4(5.0f, 5.0f, 0, 0));
        m.mainTexture.wrapMode = TextureWrapMode.Repeat;  // it wasn't repeating for me so I added this
        gridPlane.GetComponent<MeshRenderer>().material = m;
        gridPlane.GetComponent<MeshRenderer>().SetPropertyBlock(mblock);