Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: shader software emulation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shader software emulation



That shader does not compile for me...

When I fix it...
-----
attribute vec4 indices;
attribute vec3 weights;

uniform mat4 vertexMatrices[8];//fixed

void main(){

    int i0=int( indices.x );
    int i1=int( indices.y );
    int i2=int( indices.z );
    int i3=int( indices.w );

    float w0=weights.x;
    float w1=weights.y;
    float w2=weights.z;
    float w3=1.0-(w0+w1+w2);

	gl_Position = vec4(//fixed
        vertexMatrices[i0]*gl_Vertex*w0+
        vertexMatrices[i1]*gl_Vertex*w1+
        vertexMatrices[i2]*gl_Vertex*w2+
        vertexMatrices[i3]*gl_Vertex*w3 );
}
-----
This runs in HW on my quadro 4500 and x1600.

Can you send the exact shader source you are submitting to ogl + the source that does the submitting...

Also please test your shader in either Shader Builder or GLSLEditorSample (/Developer/Examples/OpenGL/Cocoa/GLSLEditorSample)
or GLSLShowpiece (There is a vertex skinning example there that runs in hw.... however it draws a rather ugly alien...)


Hope this helps....

 - Nick

On Aug 10, 2006, at 5:02 PM, Mark Sibly wrote:

Hi,

I'm doing a bit of skinning in my vertex shader, something like....

[code]
attribute vec4 indices;
attribute vec3 weights;

uniform vertexMatrices:mat4[8]

void main(){

    int i0=int( indices.x );
    int i1=int( indices.y );
    int i2=int( indices.z );
    int i3=int( indices.w );

    float w0=weights.x;
    float w1=weights.y;
    float w2=weights.z;
    float w3=1.0-(w0+w1+w2);

    vec3 vertexPosition=(
        vertexMatrices[i0]*gl_Vertex*w0+
        vertexMatrices[i1]*gl_Vertex*w1+
        vertexMatrices[i2]*gl_Vertex*w2+
        vertexMatrices[i3]*gl_Vertex*w3 );
}
[/code]

Unfortunately, enabling this drops my framerate from 60FPS to around .5, so I assume it's triggering software emulation for some reason.

Does anyone know why, or perhaps of an alternative skining method that doesn't slow things down to sub-custard speed?

Could be instruction count I guess, but the rest of the shader isn't all that complex: my setup is an Intel iMac with RadeonX1600, theoertically quite a grunty card.

Bye!
Mark

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Mac-opengl mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >shader software emulation (From: Mark Sibly <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.