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 8228215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:23:22+00:00 2026-06-07T16:23:22+00:00

I have here some glsl, And it works like a charm. Only compiling is

  • 0

I have here some glsl, And it works like a charm. Only compiling is taking 3 minutes or something. I know this is due to angle, Angle is a piece of software that converts opengl es 2.0 code to directX 9 for webgl on windows systems. if i disable angle, it compiles in a second. Does anybody know’s why nested loops are soo slow in angle. And if there is a work around? I mean i can’t just let everybody wait more than a minute per shader.

for ( int b = 0; b < numberOfSplitpoints; b++ ) {
    if ( cameraDepth > splitPoints[b] && cameraDepth < splitPoints[b+1] ) {
        const float numberOfSplitpoints = float( NUMBER_OF_SPLIT_POINTS - 1 );
        vec4 projCoords = v_projTextureCoords[b];

        projCoords /= projCoords.w;
        projCoords = 0.5 * projCoords + 0.5;

        float shadowDepth = projCoords.z;

        projCoords.x /= numberOfSplitpoints;
        projCoords.x += float(b) / numberOfSplitpoints;


        for( int x = 0; x < fullkernelSize; x++ ) {
            for( int y = 0; y < fullkernelSize; y++ ) {
                vec2 pointer = vec2( float(x-kernelsize) / 3072.0, float(y-kernelsize) / 1024.0 );
                float convolution = kernel[x] * kernel[y];
                vec4 color = texture2D(shadowMapSampler, projCoords.xy+pointer);

                if(encodeDepth( color ) + shadowBias > shadowDepth) {
                    light += convolution;
                } else {
                    light += convolution * 0.6;
                }
            }
        } 
    }
}

vec2 random = normalize(texture2D(randomSampler, screenSize * uv / 64.0).xy * 2.0 - 1.0);
float ambiantAmount = 0.0;

const int kernel = 4;

float offset = ssoasampleRad / depth;


for(int x = 0; x<kernel; x++) {

    vec2 a  = reflect(directions[x], random) * offset;

    vec2 b  = vec2( a.x *0.707 - a.y*0.707, 
                    a.x*0.707 + a.y*0.707 );

    ambiantAmount += abientOcclusion(uv, a*0.25, position, normal);
    ambiantAmount += abientOcclusion(uv, b*0.50, position, normal);
    ambiantAmount += abientOcclusion(uv, a*0.75, position, normal);
    ambiantAmount += abientOcclusion(uv, b, position, normal);
}
  • 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-07T16:23:24+00:00Added an answer on June 7, 2026 at 4:23 pm

    The GLSL ES does not define while loops and “dynamically” bounded for loops to be mandatory.
    ANGLE takes advantage of this and does extensive loop unrolling:
    If you have for ( int b = 0; b < numberOfSplitpoints; b++ ), the numberOfSplitpoints has to be constant expression, otherwise the shader won’t compile.

    The loop unrolling is supposed to allow native shader optimizer to do more optimizations and minimize divergence, but (in your code) if you have numberOfSplitpoints and fullkernelSize very large, the unrolled code can get really long (code in the inner-most part will get repeated numberOfSplitpoints*fullkernelSize*fullkernelSize times), which may cause the optimizer and compiler to go into all sorts of trouble.

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

Sidebar

Related Questions

i know this is basic but somehow i have been stuck here for some
Does anyone here have some experience with this error? Only If I use the
I have some code here which works perfectly in firefox but not in chrome
I have a table in sql 2008 named tblEmployeeAttendance like Here is some dummy
some comments here have confused me! I thought I knew this and god knows
I have a Javascript who works well, because yesterday i get here some very
I have string like 8.123.351 (Some text here) I have used the Regex /([0-9,]+(\.[0-9]{2,})+(\.[0-9]{2,})?)/
ok this is some crazy jquery code that I have here. what its doing
I have some AS3 (I am new to this!) and the only way I
The question I have here is for some reason when the getInboxUnreadMessagesCount js function

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.