Fluxor
Member
|
texScale -> Possible individually?
I want to write an algo that scales the textures according
to the individual scaling of the objects in the WE.
Problem is that "mesh" in mesh->texScale(xyz) is a pointer,
which obviously changes all instances of the original mesh in the WE to
the same base value.
So how do I deal with texture stretching on individually scaled objects and
size variation in instances?
Is it really necessary to duplicate all meshes that are scaled in any other way than
1/1/1 if we need to keep the texturing consistent? Or is there another solution?
(This post was last modified: 08-30-2021 07:56 PM by Fluxor.)
|
|
08-30-2021 07:52 PM |
|
Esenthel
Administrator
|
RE: texScale -> Possible individually?
You'd either have to make multiple copies of Mesh in the game, or write shader that adjusts the UVs in the vertex shader to your liking.
|
|
09-03-2021 07:26 AM |
|
Fluxor
Member
|
RE: texScale -> Possible individually?
Yeah, I figured. I took a look at other "places" and it is mostly the same thing there.
Usually, where it is possible on a per-mesh basis it is indeed shader-based.
Some do it per-material based.
With Esenthel we're talking HLSL shaders, right?
And as far as I remember from reading here, shaders need to be compiled
into the engine, correct?
|
|
09-03-2021 12:14 PM |
|
Esenthel
Administrator
|
RE: texScale -> Possible individually?
Yes, that has to be done by modifying the engine source.
|
|
09-04-2021 02:18 AM |
|