Starling-like VertexShader / Fragment Shader optimization

Software: Away3D 4.x

Paul Schlichter, Newbie
Posted: 17 May 2012 12:14 PM   Total Posts: 13

The new Starling 1.1 comes with optimized vertex / fragment shaders that improve mobile performance.

http://forum.starling-framework.org/topic/release-candidate-starling-11

I suppose this could be achieved in Away3D like this:

In method

DefaultScreenPass.getProjectionCode(..) 

replace

"mul op, vt7, vc4 \n"

with

"mov op, vt7 \n"

In method

BasicDiffuseMethod.getFragmentPostLightingCode(...) 

replace

code += getTexSampleCode(temp_diffuseInputRegister) +
  
// apparently, still needs to un-premultiply :s
  
"div " temp ".xyz, " temp ".xyz, " temp ".w\n"

with

if ( _needsAlphaBlending )
{
   code 
+= getTexSampleCode(temp_diffuseInputRegister) +
  
// apparently, still needs to un-premultiply :s
  
"div " temp ".xyz, " temp ".xyz, " temp ".w\n";
}
else
{
   code 
+= getTexSampleCode(temp_diffuseInputRegister);


Or am I completely wrong? :-O

Best regards,
Paul

   
   
‹‹ fix movePivot

X

Away3D Forum

Member Login

Username

Password

Remember_me



X