/* SCE CONFIDENTIAL PhyreEngine(TM) Package 2.5.0 * Copyright (C) 2009 Sony Computer Entertainment Inc. * All Rights Reserved. */ // // Example Particle Vertex Shader. // struct IN { float4 ParticlePosition : POSITION; float4 ParticleColor : COLOR; }; struct OUT { float4 clipSpace : POSITION; float psize : PSIZE; float4 color : COLOR; }; OUT main( in IN input, uniform float size, uniform float4x4 ModelView, uniform float4x4 ModelViewProj) { OUT output; float4 position = float4(input.ParticlePosition.xyz, 1.0f); float4 eyeSpacePosition = mul(ModelView, position); output.psize = size * 1280 * sqrt(1.0f / (dot(eyeSpacePosition.xyz, eyeSpacePosition.xyz))); // Transform point into clipSpace output.clipSpace = mul(ModelViewProj, position); output.color = input.ParticleColor; return output; }