use only one texCoords per surface#194
Conversation
7b4dba4 to
4079b72
Compare
|
So about the idea itself @cmf028 said this is the way to go, I would appreciate someone validating the implementation too.
|
|
LGTM |
the extra compute and boilerplate code seem useless and it already ended in bugs when parallax offset was applied to diffuse, normal, specular but nor glow map, and I would find stupid to add more boilerplate when height map will be implemented diffuse/normal/specular/glow/height maps are component of the same material, so there is no reason to handle their coordinates separately doing this would also avoid the need for a lot of ifdef code when normal/specular/glow/parallax support is disabled and well, that extra code seems useless even when they are enabled it unify the symbol names to var_TexCoords alongside the var_TexDiffuse, var_TexNormal, var_TexSpecular, var_TexGlow there was some occurrence of var_Tex some comments in already rewritten code told that Tr3b had issue with some driver/hardware suffered from "too much var" issue when passed from vp to fp shaders, leading him to abuse some variables, see 72268b, even if I have not faced this issue with hardware that is so old the game is unplayable, this is an even better way to reduce the number of variables passed from vp to fp for multimap material (diffuse/normal/specular/glow), the texCoords used is the diffuse one note that we already computed the parallax texOffset from diffuse coords only, and applied it to other maps as it would be stupid and inefficient to compute the parallax texOffset on each normal/specular/glow coords
The extra compute and boilerplate code seem useless and it already ended in bugs when parallax offset was applied to diffuse, normal, specular but nor glow map, and I would find stupid to add more boilerplate when height map will be implemented.
Diffuse/normal/specular/glow/height maps are component of the same material, so there is no reason to handle their coordinates separately.
Doing this would also avoid the need for a lot of
ifdefcode when normal/specular/glow/parallax support is disabled.And well, that extra code seems useless even when they are enabled.
It unify the symbol names to
var_TexCoords.Alongside the
var_TexDiffuse,var_TexNormal,var_TexSpecular,var_TexGlowthere was some occurrence ofvar_Tex.Some comments in already rewritten code told that Tr3b had issue with some driver/hardware suffered from "too much var" issue when passed from vp to fp shaders, leading him to abuse some variables,
see 72268b, even if I have not faced this issue with hardware that is so old the game is unplayable, this is an even better way to reduce the number of variables passed from vp to fp.
For multimap material (diffuse/normal/specular/glow), the
texCoordsused is the diffuse one.Note that we already computed the parallax
texOffsetfrom diffuse coords only, and applied it to other maps as it would be stupid and inefficient to compute the parallaxtexOffseton each normal/specular/glow coords.