java runtime error in shadowcube.vsh

    Joined
    Mar 15, 2014
    Messages
    238
    Reaction score
    68
    • Community Content - Bronze 1
    • Legacy Citizen 3
    game is totally broken now after the most recent update, v0.199.654 , and cannot load any singleplayer or multiplayer world. You have unsupported lines and syntax errors in shadowcube.vsh

    Worthy of a hotfix, maybe.
    Reported in phabricator.

    crash1.jpg
     

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    I've got this error as well and it's getting annoying.
     
    Joined
    Jul 10, 2013
    Messages
    626
    Reaction score
    486
    • Community Content - Bronze 2
    • Purchased!
    • Legacy Citizen 7
    I have this error with EVERY updates for the last 4 at least.

    I copied an old shadowcube.vsh from a copy of starmade that ran without problems and i past it into the new install and i can play.
     

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    I'll see if I can find one myself too since this is getting rather annoying. >.> What update did you have to go back to?
     
    Joined
    May 26, 2013
    Messages
    1,176
    Reaction score
    939
    • Legacy Citizen 7
    • Modder
    • Top Forum Contributor
    Here's the link to the file from the latest update. Sometimes files fail to download correctly - normally resulting in an HTML page being saved as the file instead - not an issue with the game, more the update process, Schine's file host or your isp/firewall settings.

    http://files.star-made.org/build/st...40955/data/shader/cube/quads13/shadowcube.vsh

    place the file in the folder:
    \StarMade\data\shader\cube\quads13

    Within your starmade install.

    EDIT:
    This is what the file should have inside it (check with notepad/wordpad)
    Code:
    #IFDEF force130
    #version 130
    #ELSE
    #version 120
    #ENDIF
    
    #IFDEF force130
    //no extension needed for using version 130
    #ELSEIF shader4
    #extension GL_EXT_gpu_shader4: enable
    #ENDIF
    
    #IFDEF INTATT
        attribute ivec4 ivert;
    #ENDIF
    
    const float tiling = 0.0625;
    const float tilingH = 0.03;
    const float adi = 0.00485;
    
    varying vec2 mainTexCoords;
    varying float layer;
    varying float extraAlphaVert;
    
    uniform int animationTime;
    uniform vec3 shift;
    uniform vec3 normals[7];
    uniform vec3 quadPosMark[6];
    uniform float lodThreshold;
    void main()
    {
        vec4 vPos;
    
        #IMPORT data/shader/cube/quads13/cubeEncoding.glsl
        
        
        float type = typeE;
    
        vec2 texCoords;
        
        layer = layerE;
        
        float mVertNumQuarters = (vertNumCodeE) * 0.25;
        float mTex = (extFlag) * 0.25;
        
        
        
        if(!onlyInBuildMode){
            type += animatedE * animationTime;
        }
        
        #IFDEF shader4
            int typeI = int(type);
            float xIndex = typeI & 15;
            float yIndex = typeI >> 4; // / 16.0
        #ELSE
            float xIndex = mod(type, 16.0);
            float yIndex = floor(type * 0.0625 ); // / 16.0
        #ENDIF
        
        
        #IFDEF shader4
             //8,8,8 = 8736
            
            vec3 cubePos = vec3(    float((int(vIndex) ) & 31),
                            float((int(vIndex) >> 5) & 31),
                            float((int(vIndex) >> 10) & 31));
        #ELSE
             //8,8,8 = 8736
            float z = floor(vIndex / 1024.0);
            vIndex -= z * 1024.0;
            float y = floor(vIndex * 0.03125); //div by 32
            vIndex -= y * 32.0;
            float x = vIndex;
            
            vec3 cubePos = vec3(x,y,z);
        #ENDIF
        
        vec3 vertexPos = cubePos - 16.0;
        
        #IFDEF shader4
        vec2 quad = vec2(
                float(int(mTex * 2.0) & 1),
                float(int(mTex * 4.0) & 1)
                );
        //either 0,0; 0,1; 1,1; 1,0
        #ELSE
        vec2 quad = vec2(
                mod(floor(mTex * (2.0)), 2.0),
                mod(floor(mTex * (4.0)), 2.0)
                );
        //either 0,0; 0,1; 1,1; 1,0
        #ENDIF
        
        
        float eleVertEdge = (eleEV*0.25);
        
        #IFDEF shader4
        
        
        
        vec3 mm = vec3(float(int(mVertNumQuarters * qpm.x) & 1),
            float(int(mVertNumQuarters * qpm.y) & 1),
            float(int(mVertNumQuarters * qpm.z) & 1));
        
        
        #ELSE
        
        vec3 mm = vec3(mod(floor(mVertNumQuarters * qpm.x), 2.0),
            mod(floor(mVertNumQuarters * qpm.y), 2.0),
            mod(floor(mVertNumQuarters * qpm.z), 2.0));
        
        
        #ENDIF
        
        
        vec3 mExtra = vec3(
                    (((qpm.x == 4.0 && xyScaleManip > 0.5) || (qpm.x == 2.0 && xyScaleManip < 0.5)) ? eleVertEdge * (mm.x > 0.0 ? 1.0 : -1.0) : 0.0),
                    (((qpm.y == 4.0 && xyScaleManip > 0.5) || (qpm.y == 2.0 && xyScaleManip < 0.5)) ? eleVertEdge * (mm.y > 0.0 ? 1.0 : -1.0) : 0.0),
                    (((qpm.z == 4.0 && xyScaleManip > 0.5) || (qpm.z == 2.0 && xyScaleManip < 0.5)) ? eleVertEdge * (mm.z > 0.0 ? 1.0 : -1.0) : 0.0));
            
        
        vec3 P = vec3(    ((((-0.5) - (abs(normalPos.x) * -0.5)))  + mm.x - mExtra.x) ,
                        ((((-0.5) - (abs(normalPos.y) * -0.5)))  + mm.y - mExtra.y) ,
                        ((((-0.5) - (abs(normalPos.z) * -0.5)))  + mm.z - mExtra.z) );
        
        vertexPos += P + ((normalPos * 0.5) - (eleE * normalPos * 0.25));   
        
        
        vertexPos += ((chunkPos - vec3(128.0)) + shift)*32.0;
            
        vPos = gl_ModelViewMatrix * vec4(vertexPos,1.0);
        
        float adiNorm = adi;// + maxadiplus * min(1.0, (max(0.0, length(vPos) - 60.0)*0.065));
        vec2 adip = vec2(
        ((1.0 -((quad.x)*adiNorm)) + (abs(quad.x - 1.0)*adiNorm)),
        ((1.0 -((quad.y)*adiNorm)) + (abs(quad.y - 1.0)*adiNorm)));
    
        texCoords = vec2(quad.x *tiling, quad.y *tiling );
    
        
        
        vec2 vcord = vec2(texCoords);
        
        
        mainTexCoords.st = vec2( texCoords.x + tiling * xIndex, texCoords.y + tiling * yIndex);
        mainTexCoords.st += adip;
        
        
        //handle the special transparent texture (dispaly in build mode)
        if(onlyInBuildMode && animatedE < 0.001){
            extraAlphaVert = -10.0;
        }else{
            extraAlphaVert = 0.0;
        }
        
        float ts = lodThreshold;
        float smoother = ts * 0.125; //one eight of distance is smoothing
        if(onlyInBuildMode && animatedE > 0.0 ){
            float len = length(vPos.xyz);
            if(len < ts-smoother){
                extraAlphaVert = -10.0;
            }else if(len < ts){
                float dist = (ts - length(vPos.xyz));
                extraAlphaVert = -dist/smoother;//-((ts)-length(vPos)) * 0.0625 ;
            }else{
                extraAlphaVert = 0.0;
            }
        }
        
        gl_Position =  gl_ProjectionMatrix * vPos;
        
    }
     

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    hmm didn't work on my end, got the same error again.
     

    Attachments

    Joined
    May 26, 2013
    Messages
    1,176
    Reaction score
    939
    • Legacy Citizen 7
    • Modder
    • Top Forum Contributor
    ahh interesting.
    By any chance are you running with shadows turned on?
    If so - try disabling them - if you can't access the main menu, edit settings.cfg
     
    Joined
    Jul 10, 2013
    Messages
    626
    Reaction score
    486
    • Community Content - Bronze 2
    • Purchased!
    • Legacy Citizen 7
    Here's the link to the file from the latest update. Sometimes files fail to download correctly - normally resulting in an HTML page being saved as the file instead - not an issue with the game, more the update process, Schine's file host or your isp/firewall settings.

    http://files.star-made.org/build/st...40955/data/shader/cube/quads13/shadowcube.vsh

    place the file in the folder:
    \StarMade\data\shader\cube\quads13

    Within your starmade install.

    EDIT:
    This is what the file should have inside it (check with notepad/wordpad)
    Code:
    #IFDEF force130
    #version 130
    #ELSE
    #version 120
    #ENDIF
    
    #IFDEF force130
    //no extension needed for using version 130
    #ELSEIF shader4
    #extension GL_EXT_gpu_shader4: enable
    #ENDIF
    
    #IFDEF INTATT
        attribute ivec4 ivert;
    #ENDIF
    
    const float tiling = 0.0625;
    const float tilingH = 0.03;
    const float adi = 0.00485;
    
    varying vec2 mainTexCoords;
    varying float layer;
    varying float extraAlphaVert;
    
    uniform int animationTime;
    uniform vec3 shift;
    uniform vec3 normals[7];
    uniform vec3 quadPosMark[6];
    uniform float lodThreshold;
    void main()
    {
        vec4 vPos;
    
        #IMPORT data/shader/cube/quads13/cubeEncoding.glsl
       
       
        float type = typeE;
    
        vec2 texCoords;
       
        layer = layerE;
       
        float mVertNumQuarters = (vertNumCodeE) * 0.25;
        float mTex = (extFlag) * 0.25;
       
       
       
        if(!onlyInBuildMode){
            type += animatedE * animationTime;
        }
       
        #IFDEF shader4
            int typeI = int(type);
            float xIndex = typeI & 15;
            float yIndex = typeI >> 4; // / 16.0
        #ELSE
            float xIndex = mod(type, 16.0);
            float yIndex = floor(type * 0.0625 ); // / 16.0
        #ENDIF
       
       
        #IFDEF shader4
             //8,8,8 = 8736
           
            vec3 cubePos = vec3(    float((int(vIndex) ) & 31),
                            float((int(vIndex) >> 5) & 31),
                            float((int(vIndex) >> 10) & 31));
        #ELSE
             //8,8,8 = 8736
            float z = floor(vIndex / 1024.0);
            vIndex -= z * 1024.0;
            float y = floor(vIndex * 0.03125); //div by 32
            vIndex -= y * 32.0;
            float x = vIndex;
           
            vec3 cubePos = vec3(x,y,z);
        #ENDIF
       
        vec3 vertexPos = cubePos - 16.0;
       
        #IFDEF shader4
        vec2 quad = vec2(
                float(int(mTex * 2.0) & 1),
                float(int(mTex * 4.0) & 1)
                );
        //either 0,0; 0,1; 1,1; 1,0
        #ELSE
        vec2 quad = vec2(
                mod(floor(mTex * (2.0)), 2.0),
                mod(floor(mTex * (4.0)), 2.0)
                );
        //either 0,0; 0,1; 1,1; 1,0
        #ENDIF
       
       
        float eleVertEdge = (eleEV*0.25);
       
        #IFDEF shader4
       
       
       
        vec3 mm = vec3(float(int(mVertNumQuarters * qpm.x) & 1),
            float(int(mVertNumQuarters * qpm.y) & 1),
            float(int(mVertNumQuarters * qpm.z) & 1));
       
       
        #ELSE
       
        vec3 mm = vec3(mod(floor(mVertNumQuarters * qpm.x), 2.0),
            mod(floor(mVertNumQuarters * qpm.y), 2.0),
            mod(floor(mVertNumQuarters * qpm.z), 2.0));
       
       
        #ENDIF
       
       
        vec3 mExtra = vec3(
                    (((qpm.x == 4.0 && xyScaleManip > 0.5) || (qpm.x == 2.0 && xyScaleManip < 0.5)) ? eleVertEdge * (mm.x > 0.0 ? 1.0 : -1.0) : 0.0),
                    (((qpm.y == 4.0 && xyScaleManip > 0.5) || (qpm.y == 2.0 && xyScaleManip < 0.5)) ? eleVertEdge * (mm.y > 0.0 ? 1.0 : -1.0) : 0.0),
                    (((qpm.z == 4.0 && xyScaleManip > 0.5) || (qpm.z == 2.0 && xyScaleManip < 0.5)) ? eleVertEdge * (mm.z > 0.0 ? 1.0 : -1.0) : 0.0));
           
       
        vec3 P = vec3(    ((((-0.5) - (abs(normalPos.x) * -0.5)))  + mm.x - mExtra.x) ,
                        ((((-0.5) - (abs(normalPos.y) * -0.5)))  + mm.y - mExtra.y) ,
                        ((((-0.5) - (abs(normalPos.z) * -0.5)))  + mm.z - mExtra.z) );
       
        vertexPos += P + ((normalPos * 0.5) - (eleE * normalPos * 0.25));  
       
       
        vertexPos += ((chunkPos - vec3(128.0)) + shift)*32.0;
           
        vPos = gl_ModelViewMatrix * vec4(vertexPos,1.0);
       
        float adiNorm = adi;// + maxadiplus * min(1.0, (max(0.0, length(vPos) - 60.0)*0.065));
        vec2 adip = vec2(
        ((1.0 -((quad.x)*adiNorm)) + (abs(quad.x - 1.0)*adiNorm)),
        ((1.0 -((quad.y)*adiNorm)) + (abs(quad.y - 1.0)*adiNorm)));
    
        texCoords = vec2(quad.x *tiling, quad.y *tiling );
    
       
       
        vec2 vcord = vec2(texCoords);
       
       
        mainTexCoords.st = vec2( texCoords.x + tiling * xIndex, texCoords.y + tiling * yIndex);
        mainTexCoords.st += adip;
       
       
        //handle the special transparent texture (dispaly in build mode)
        if(onlyInBuildMode && animatedE < 0.001){
            extraAlphaVert = -10.0;
        }else{
            extraAlphaVert = 0.0;
        }
       
        float ts = lodThreshold;
        float smoother = ts * 0.125; //one eight of distance is smoothing
        if(onlyInBuildMode && animatedE > 0.0 ){
            float len = length(vPos.xyz);
            if(len < ts-smoother){
                extraAlphaVert = -10.0;
            }else if(len < ts){
                float dist = (ts - length(vPos.xyz));
                extraAlphaVert = -dist/smoother;//-((ts)-length(vPos)) * 0.0625 ;
            }else{
                extraAlphaVert = 0.0;
            }
        }
       
        gl_Position =  gl_ProjectionMatrix * vPos;
       
    }
    That don't work with me.

    Mine start like that :

    #IFDEF INTATT
    #version 130
    #ELSE
    #version 120
    #ENDIF

    #IFDEF shader4
    #extension GL_EXT_gpu_shader4: enable
    #ENDIF

    #IFDEF INTATT
    attribute ivec4 ivert;
    #ENDIF
     

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    ahh interesting.
    By any chance are you running with shadows turned on?
    If so - try disabling them - if you can't access the main menu, edit settings.cfg
    Shadows are off for me but I'll check to see if the settings menu and the config are different

    Edit: Ya nothing different from the options menu unless I missed something.
     

    Attachments

    Lancake

    Head of Testing
    Joined
    Aug 20, 2013
    Messages
    794
    Reaction score
    560
    • Schine
    • Tester
    Odd.
    Your GPU doesn't support shader4, which is checked for. It doesn't support it, yet it says it does to the game. Resulting in this crash as it definitely cannot use those features.

    As the GPU reports something false, there's not much you can do about it on that side. You can however force that not supported tool from being enabled.

    A possible workaround:
    In your settings.cfg file, located in the ./StarMade folder, change
    G_USE_SHADER4 = true
    To
    G_USE_SHADER4 = false
    Save the change you've made, then try again.
     

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    It'd be nice if this setting was visible in the options menu, never saw the thing. >.<
     

    Lancake

    Head of Testing
    Joined
    Aug 20, 2013
    Messages
    794
    Reaction score
    560
    • Schine
    • Tester
    It'd be nice if this setting was visible in the options menu, never saw the thing. >.<
    Several settings that are hidden in the menu, as these are settings you're not supposed to touch in normal situations. Accidentally changing one or more could ruin it and require a settings wipe.

    Did it help or do you still get an error? If the error is different, I wouldn't mind seeing another log file.
     

    Lancake

    Head of Testing
    Joined
    Aug 20, 2013
    Messages
    794
    Reaction score
    560
    • Schine
    • Tester
    EDIT

    Change another setting in your settings.cfg
    USE_INTEGER_VERTICES = true
    to
    USE_INTEGER_VERTICES = false

    If that doesn't work, try the one below.
    ---

    Replace the cubegrp.vert.glsl file with the one I uploaded here.
    It's located in your ./StarMade/data/shader/cube/groups folder.
     

    Attachments

    Joined
    Mar 15, 2014
    Messages
    238
    Reaction score
    68
    • Community Content - Bronze 1
    • Legacy Citizen 3
    I don't believe it's an error from,the launcher, i.e. a file download error. It is an error either from the gpu or java or starmade sending the wrong values. Either way, my only successful fix was to comment out the offending lines in shadowcube.vsh , and that fixed it. Will upload later.
     

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    Found a copy of the game that runs for me, v0.199.646
    No idea what's up with the difference but this copy of the shadowcube.vsh file runs for me and doesn't crash so far. :)
     

    Attachments

    Joined
    Mar 15, 2014
    Messages
    238
    Reaction score
    68
    • Community Content - Bronze 1
    • Legacy Citizen 3
    Ok, basically this will be an easy fix for anyone now, but was hard to figure out.

    Open shadowcube.vsh in notepad then do the following:

    Code:
    #IFDEF force130
    #version 130
    #ELSE
    #version 130
    #ENDIF
    
    #IFDEF force130
    //no extension needed for using version 130
    #ELSEIF shader4
    //#extension GL_EXT_gpu_shader4: disable
    #ENDIF
     
    Joined
    Oct 8, 2014
    Messages
    138
    Reaction score
    207
    • Community Content - Bronze 2
    • Purchased!
    • Legacy Citizen 10
    I found the solution.
    In launcher, go back to ver 0.199.646 which should run perfectly fine. then, go to \StarMade\data\shader\cube\quads13 and copy the shadowcube.vsh file somewhere else.
    Update to latest release via launcher and again go to \StarMade\data\shader\cube\quads13 and replace the present shadowcube.vsh with the one you copied