Subversion Repository Public Repository

Divide-Dependencies

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include <config.cg>
#include <globals.cg>
#include <tessellation.cg>

VertexOut  vmain(__in(float4,      localSpacePosition, POSITION)
                 __in_opt(float3,  localSpaceNormal,   NORMAL)
                 __in_opt(float4,  localSpaceTangent,  SEMANTIC_TANGENT)
                 __in_opt(float4,  vertexTexcoord0,    TEXCOORD0)
                 __in_opt(float4,  vertexTexcoord1,    TEXCOORD1)
                 __in_opt(float4,  vertexTexcoord2,    TEXCOORD2)
                 __in_opt(float4,  vertexTexcoord3,    TEXCOORD3)
                 __in_opt(half4,   vertexColor,        COLOR)
               #if RENDERER_INSTANCED
                 , __in(float3,   instanceOffset,      SEMANTIC_INSTANCE_T)
                 , __in(float3,   instanceNormalX,     SEMANTIC_INSTANCE_X)
                 , __in(float3,   instanceNormalY,     SEMANTIC_INSTANCE_Y)
                 , __in(float3,   instanceNormalZ,     SEMANTIC_INSTANCE_Z)
                 __in_opt(float2, instanceUVOffset,    SEMANTIC_INSTANCE_UV)
                 __in_opt(float3, instanceLocalOffset, SEMANTIC_INSTANCE_LOCAL)
               #endif
               #if RENDERER_DISPLACED
                 __in_opt(uint,   vertexFlagsDisp,     SEMANTIC_DISPLACEMENT_FLAGS)
               #endif
                )
{
	VertexOut vout;

#if !defined(GLSL_COMPILER)
	float4x4 modelMatrix;
#if RENDERER_INSTANCED
	modelMatrix = mul(g_modelMatrix, transpose(float4x4(float4(instanceNormalX, 0), float4(instanceNormalY, 0), float4(instanceNormalZ, 0), float4(instanceOffset, 1))));
#else
	modelMatrix = g_modelMatrix;
#endif
#endif

#if !defined(GLSL_COMPILER)
	float4x4 mvm                   = mul(g_viewMatrix, modelMatrix);
	float4x4 mvpm                  = mul(g_projMatrix, mvm);
	vout.screenSpacePosition       = mul(mvpm, localSpacePosition);
#else
	vout.screenSpacePosition       = mul(g_MVP, localSpacePosition);
#endif

#if !defined(GLSL_COMPILER)
	vout.params.worldSpacePosition = mul(modelMatrix, localSpacePosition).xyz;
	vout.params.worldSpaceNormal   = normalize(mul(modelMatrix, float4(localSpaceNormal,  0)).xyz);
	vout.params.worldSpaceTangent  = normalize(mul(modelMatrix, float4(localSpaceTangent.xyz, 0)).xyz);
	vout.params.worldSpaceBinormal = cross(vout.params.worldSpaceNormal, vout.params.worldSpaceTangent) * localSpaceTangent.w;
#else
	vout.params.worldSpacePosition = mul(g_modelMatrix, localSpacePosition).xyz;
	vout.params.worldSpaceNormal   = normalize(mul(g_modelMatrix, float4(localSpaceNormal,  0)).xyz);
#endif
#if RENDERER_INSTANCED
	vout.params.texcoord0   = vertexTexcoord0 + float4(instanceUVOffset, 0, 0);
#else
	vout.params.texcoord0   = vertexTexcoord0;
#endif
#if !defined(GLSL_COMPILER)
	vout.params.texcoord1   = vertexTexcoord1;
	vout.params.texcoord2   = vertexTexcoord2;
#if !defined (RENDERER_WIN8ARM)		
	vout.params.texcoord3   = vertexTexcoord3;
#endif	
#endif
	vout.params.color       = swizzle(vertexColor);

#if RENDERER_DISPLACED
	vout.localPosition       = localSpacePosition;
#if RENDERER_INSTANCED
	vout.localPosition      += instanceLocalOffset;
#endif
	vout.flagsDisp           = vertexFlagsDisp;
	vout.modelMatrix[0]      = modelMatrix[0];
	vout.modelMatrix[1]      = modelMatrix[1];
	vout.modelMatrix[2]      = modelMatrix[2];
	vout.modelMatrix[3]      = modelMatrix[3];
#endif

	return vout;
}

Commits for Divide-Dependencies/physx/APEX_1.4/media/SampleRenderer/4/shaders/vertex/staticmesh.cg

Diff revisions: vs.
Revision Author Commited Message
105 IonutCava picture IonutCava Tue 16 Apr, 2019 19:55:41 +0000

Forgot to actually add physx