About Store Forum Documentation Contact



Post Reply 
texScale -> Possible individually?
Author Message
Fluxor Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
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
Find all posts by this user Quote this message in a reply
Fluxor Offline
Member

Post: #3
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: texScale -> Possible individually?
Yes, that has to be done by modifying the engine source.
09-04-2021 02:18 AM
Find all posts by this user Quote this message in a reply
Post Reply