/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (c) 2004-2013 HUBzero Foundation, LLC * * Authors: * Wei Qiao */ void main(in float4 posin : POSITION, in float4 colin : COLOR0, out float psize : PSIZE, out float4 posout : POSITION, out float4 colout : COLOR0, uniform float atten, //uniform sampler2D normal, uniform float4 posoffset, uniform float4 basepos, uniform float4 scale, uniform float4x4 modelview, uniform float4x4 projection) { float4 vec, homeye, eye; vec.xyz = posin.xyz; vec.w = 1.0; homeye = mul(modelview, vec); posout = mul(projection, homeye); float4 p = mul(modelview, vec); //psize = scale.x *(p.w / -p.z) * 10; //psize = 5 * scale.x; //psize = 2 * p.w / -p.z; //colout = float4(colin.xyz,0.1); float tmp = posin.w * rsqrt(dot(eye.xyz, eye.xyz)); psize = scale.x * max(tmp, 1.0); psize = 10 * p.w / -p.z; colout = float4(colin.xyz, colin.w * 0.25); }