/* -*- 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 modelViewProj) { float4 vec, homeye, eye; vec.xyz = posin.xyz; vec.w = 1.0; homeye = mul(modelView, vec); posout = mul(modelViewProj, posin); 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); /* float4 vec, homeye, eye; float tmp; vec.xyz = posin.xyz;//(posin.xyz + posoffset.www) * basepos.www + basepos.xyz; vec.w = 1.0; homeye = mul(modelView, vec); posout = mul(projection, homeye); //eye = homeye / homeye.w; //tmp = posin.w * basepos.w * scale.w * rsqrt(atten * dot(eye.xyz, eye.xyz)); //psize = scale.x * max(tmp, 1.0); //tmp = min(tmp, 1.0); //colout = colin; //tmp = colin.w * scale.z * tmp * tmp; //colout.w = max(tmp, 4.0/256); psize = 5.0; colout = float4(0.0, 0.0, 1.0, 0.1); */ }