Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7851337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:09:00+00:00 2026-06-02T19:09:00+00:00

To start with my main question: Can I use pixel shader model 3, 4

  • 0

To start with my main question:

Can I use pixel shader model 3, 4 or 5 in my FireMonkey applications?

I want to be able to dynamically create pixel shaders in my FireMonkey program.
To do that, I now compile a pixel shader using fxc.exe that comes with the DirectX SDK, and load the compiled code into my TShaderFilter descendant. That works fine (let me know if you’re interested in how I do that).

However, I can only get things to work if I compile with ps_2_0 as a target profile.

I’m currently running into limitations of shader model 2.0. For example loops seem to be unrolled by the compiler, and there’s a maximum number of instructions that you can have in level 2 shaders. Because of that, the number of possibilities are pretty limited.


Example:
The shader code below creates a mandelbrot fractal. If I set Iterations too high, it doesn’t compile. Error message:

error X5608: Compiled shader code uses too many arithmetic instruction slots (78). Max. allowed by the target (ps_2_0) is 64.

#define Iterations 12

float2 Pan;
float Zoom;
float Aspect;
float4 main(float2 texCoord : TEXCOORD0) : COLOR0
{
    float2 c = (texCoord - 0.5) * Zoom * float2(1, Aspect) - Pan;
    float2 v = 0;        
    for (int n = 0; n < Iterations; n++)
    {
        v = float2(v.x * v.x - v.y * v.y, v.x * v.y * 2) + c;
    }        
    return (dot(v, v) > 1) ? 1 : 0;
}

With shader model ps_3_0 I can compile with more iterations, but the compiled shader doesn’t seem to work in FireMonkey. I don’t get any error message; I just get a red image as a result.


Does anyone here have any idea on how to get around this, or is FireMonkey just not capable of utilizing the full potential of my graphics card?

Note, I’ve seen that the minimum requirement for FireMonkey is a graphics card with shader level 2.0, but it’s not clear if that means you cannot use shader level 3 or higher.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:09:03+00:00Added an answer on June 2, 2026 at 7:09 pm

    This answer is correct at the time of writing, but will possibly change as FireMonkey develops:

    You cannot use PixelShader or ShaderModel 3.0 or higher, as FireMonkey (under Windows) uses DirectX 9, while PixelShader/ShaderModel 3.0+ are features of DirectX 10.
    If you look in Winapi.D3DX9.pas (lines 2871-2872), you’ll be able to confirm that ps_3_0 is not a valid token here, while in Winapi.D3DX10.pas (lines 3224-3230) it is supported.

    So, the only way you’d be able to use PixelShader/ShaderModel 3.0+ would be to either modify FireMonkey yourself to use a DirectX 10 context, or request (with the backing of others) that Embarcadero change this for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a little question.How can I repair that code so I can use
Like start at c:\ (or whatever the main drive is) and then randomly take
I have the main thread from which I start a window using invokeLater .
My Java class contains the following methods: public static void main(String[] argv) //start the
My Lex file main.l : %{ #include <stdio.h> %} %% start printf(Start command received\n);
#include<stdio.h> #include<time.h> int main() { clock_t start; double d; long int n,i,j; scanf(%ld,&n); n=100000;
The system realizes a game Think animal. Main use case is: 1. System offers
I'm using WPF and C#. I want to be able to launch a browser
This is an Android noob question. I am trying to start an activity of
Update: question now contains the final edited answer! I now use the following (final

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.