mirror of
https://github.com/jmarshall23/Doom3MegaTexture.git
synced 2026-08-12 08:00:58 +02:00
70 lines
3.0 KiB
Plaintext
70 lines
3.0 KiB
Plaintext
/*
|
|
===========================================================================
|
|
|
|
IcedTech GPL Source Code
|
|
|
|
Copyright (C) 2019 Real Vector Math Studios(Justin Marshall).
|
|
|
|
This file is part of the IcedTech GPL Source Code ("IcedTech GPL Source Code").
|
|
|
|
IcedTech GPL Source Code is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
IcedTech GPL Source Code is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with IcedTech GPL Source Code. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
In addition, the IcedTech GPL Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the IcedTech GPL Source Code. If not, please request a copy in writing from id Software at the address below.
|
|
|
|
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
|
|
|
|
===========================================================================
|
|
*/
|
|
|
|
#include "global.inc"
|
|
|
|
struct VS_IN {
|
|
float4 position : POSITION;
|
|
float2 texcoord : TEXCOORD0;
|
|
float4 normal : NORMAL;
|
|
float4 tangent : TANGENT;
|
|
float4 color : COLOR0;
|
|
};
|
|
|
|
struct VS_OUT {
|
|
float4 position : POSITION;
|
|
float2 texcoord0 : TEXCOORD0;
|
|
float2 texcoord1 : TEXCOORD1;
|
|
float2 texcoord2 : TEXCOORD2;
|
|
float2 texcoord3 : TEXCOORD3;
|
|
float2 texcoord4 : TEXCOORD4;
|
|
float2 texcoord5 : TEXCOORD5;
|
|
float2 texcoord6 : TEXCOORD6;
|
|
float4 texcoord7 : TEXCOORD7;
|
|
};
|
|
|
|
void main( VS_IN vertex, out VS_OUT result ) {
|
|
result.position.x = dot4( vertex.position, rpMVPmatrixX );
|
|
result.position.y = dot4( vertex.position, rpMVPmatrixY );
|
|
result.position.z = dot4( vertex.position, rpMVPmatrixZ );
|
|
result.position.w = dot4( vertex.position, rpMVPmatrixW );
|
|
|
|
// Megatexture masks, (texCoord * scale) + offset.
|
|
result.texcoord0.xy = (vertex.texcoord * rpMegaTextureLevel0.w) + rpMegaTextureLevel0.xy;
|
|
result.texcoord1.xy = (vertex.texcoord * rpMegaTextureLevel1.w) + rpMegaTextureLevel1.xy;
|
|
result.texcoord2.xy = (vertex.texcoord * rpMegaTextureLevel2.w) + rpMegaTextureLevel2.xy;
|
|
result.texcoord3.xy = (vertex.texcoord * rpMegaTextureLevel3.w) + rpMegaTextureLevel3.xy;
|
|
result.texcoord4.xy = (vertex.texcoord * rpMegaTextureLevel4.w) + rpMegaTextureLevel4.xy;
|
|
result.texcoord5.xy = (vertex.texcoord * rpMegaTextureLevel5.w) + rpMegaTextureLevel5.xy;
|
|
result.texcoord6.xy = (vertex.texcoord * rpMegaTextureLevel6.w) + rpMegaTextureLevel6.xy;
|
|
|
|
// Images only have scale.
|
|
result.texcoord7.xy = vertex.texcoord * rpMegaTextureLevel6.w;
|
|
result.texcoord7.zw = vertex.texcoord;
|
|
} |