[0.199.113] Fails to start, crashes on shader compile.

    Joined
    Jun 24, 2013
    Messages
    270
    Reaction score
    43
    v 0.199.113 not loading. It gets to about 25% and presents this:



    Relevant(?) log entry:

    [2016-07-25 19:53:57] [INIT][CLIENT][SHADER] Loading Shader: data//shader/cube/quads13/cube-3rd.vsh; data//shader/cube/quads13/cubeTArray.fsh
    [2016-07-25 19:53:57] #version 120
    #extension GL_EXT_gpu_shader4: enable


    in ivec4 ivert;


    //threcomp needs index 0 to be 0
    uniform vec3 normals[7];








    uniform vec3 specular = vec3(0.45,0.45,0.45);
    uniform vec4 zo = vec4(0.0, 0.0, 0.0, 1.0);
    uniform vec3 daa = vec3(1.4,1.4,1.4);
    uniform vec3 dsa = vec3(2.20,2.20,1.60);
    uniform vec3 ambient = vec3(0.45,0.45,0.45);
    uniform vec3 diffuse = vec3(1.0,1.0,1.0);

    vec3 vertexLightFunc(vec3 normalVec, vec3 lightDir, vec3 pos, vec3 viewDirection, vec4 occlusionVec){

    vec3 normalDirection = normalVec;


    float nDotL = dot(normalDirection, lightDir);


    if (nDotL <= 0.0) // light source on the wrong side?
    {
    return (ambient * diffuse.rgb * (occlusionVec.xyz * 3.5 + occlusionVec.w)).xyz;
    }
    else // light source on the right side
    {

    vec3 lightDiffuse = daa * occlusionVec.w; ;
    vec3 lightSpecular = dsa * occlusionVec.w*occlusionVec.w * (diffuse.rgb);

    vec3 diffuseReflection = 1.2 * lightDiffuse * diffuse.rgb * nDotL; //1.1 = attenuation

    vec3 specularReflection = 0.6 * lightSpecular * specular
    * pow(max(0.0, dot(reflect(-lightDir, normalDirection), normalize(viewDirection))), 40.0); //30 = shininess, 1.1 = attenuation

    return (ambient * diffuse.rgb * (occlusionVec.xyz * 3.5 + occlusionVec.w)).xyz + diffuseReflection.xyz + specularReflection.xyz;
    }
    }




    uniform vec3 shift;
    uniform vec3 quadPosMark[6];
    const float tiling = 0.0625;
    const float tilingH = 0.03;
    const float adi = 0.00485;
    const float maxadiplus = 0.0099;
    const float oreOverlayStartingRow = 1.0;
    uniform float lodThreshold;
    uniform int animationTime;
    uniform int allLight;



    varying vec4 occlusion;
    varying vec3 lightDir;
    varying vec3 viewDirection;
    varying vec4 vPos;
    varying vec3 normalVec;
    varying float extraAlphaVert;
    varying vec3 vertexLight;


    varying vec3 lightDirSpot;

    varying float layer;



    /*
    void colorSide(float side){
    if(side == 0.0){
    //front
    light = vec4(1.0, 0.0, 0.0, 1.0);
    }else if(side == 1.0){
    //back
    light = vec4(0.0, 1.0, 0.0, 1.0);
    }else if(side == 2.0){
    //top
    //light = vec4(0.0, 0.0, 1.0, 1.0);
    }else if(side == 3.0){
    //bot
    //light = vec4(1.0, 1.0, 0.0, 1.0);
    }else if(side == 4.0){
    //right
    light = vec4(0.0, 0.0, 1.0, 1.0);
    }else if(side == 5.0){
    //left
    light = vec4(0.0, 1.0, 1.0, 1.0);
    }

    }
    */


    vec4 fromtwovectors(vec3 uu, vec3 vv)
    {
    vec3 w = cross(uu.xyz, vv.xyz).xyz;
    vec4 q = vec4(dot(uu, vv), w.x, w.y, w.z);

    float l = w.x*w.x + w.y*w.y + w.z*w.z;//sqlength(w);

    q.w += sqrt(q.w*q.w+l);

    return q*(1.0/sqrt(q.w*q.w+l));
    }
    vec4 slerp4(vec4 p0, vec4 p1, float t)
    {
    float dotp = dot(normalize(p0), normalize(p1));
    if ((dotp > 0.9999) || (dotp<-0.9999))
    {
    if (t<=0.5)
    return p0;
    return p1;
    }
    float theta = acos(dotp * 3.14159/180.0);
    vec4 P = ((p0*sin((1-t)*theta) + p1*sin(t*theta)) / sin(theta));
    P.w = 1.0;
    return P;
    }
    vec3 slerp(vec3 a, vec3 b, float t)
    {
    vec4 qa = vec4(0.0,0.0,0.0,1.0);
    vec4 qb;
    //qa = Quaternionf::Identity();
    qb = fromtwovectors(a,b);
    return (slerp4(qa, qb, t)).xyz; // * a ?
    }

    void main()
    {

    float xyScaleManip = 0.0;

    vec3 normal;

    int indexInfo = ivert.x;

    float vIndex = float((indexInfo ) & 32767);

    float red = float((indexInfo >> 16) & 3);

    float green = float((indexInfo >> 18) & 3);

    float blue = float((indexInfo >> 20) & 3);




    int info = ivert.y;

    float vertNumCodeE = float(info & 3);

    int sideId = (info >> 2) & 7;

    float layerE = float((info >> 5) & 7);

    xyScaleManip = float((info >> 8) & 1);

    float typeE = float((info >> 9) & 255) ;

    float hitPointsE = float((info >> 17) & 7) ;

    float animatedE = float((info >> 20) & 1);

    float extFlag = float((info >> 21) & 3);

    bool onlyInBuildMode = float((info >> 23) & 1) > 0.0;


    int normalIndex = sideId;
    vec3 qpm = quadPosMark[normalIndex];


    vec3 chunkPos;



    float oreOverlayE = 0.0;
    float occE = 0.0;
    float eleE = 0.0;
    float eleEV = 0.0;



    int pCode = ivert.z;
    chunkPos = vec3(float(pCode & 255), float((pCode >> 8) & 255), float((pCode >> 16) & 255));

    int eInfoW = ivert.w;
    eleEV = (eInfoW >> 22) & 3 ;

    eleE = (eInfoW >> 20) & 3 ;

    occE = (eInfoW >> 16) & 15;

    oreOverlayE = (eInfoW >> 10) & 63;

    vec3 normalPos = normals[normalIndex+1];

    if((eInfoW & 511) == 0){
    normal = normalPos;
    }else{
    vec3 com = normals[(eInfoW >> 6) & 7] + normals[(eInfoW >> 3) & 7] + normals[eInfoW & 7];
    normal = normalize(com);
    }


    float type = typeE;

    vec2 texCoords;


    float mVertNumQuarters = (vertNumCodeE) * 0.25;
    float mTex = (extFlag) * 0.25;


    occlusion = vec4(red * 0.066666, green * 0.066666, blue * 0.066666, occE * 0.066666); // / 15

    occlusion.w = max(0.15, occlusion.w);

    layer = layerE;


    if(!onlyInBuildMode){
    type += animatedE * animationTime;
    }


    int typeI = int(type);
    float xIndex = typeI & 15;
    float yIndex = typeI >> 4; // / 16.0


    //8,8,8 = 8736

    vec3 cubePos = vec3( float((int(vIndex) ) & 31),
    float((int(vIndex) >> 5) & 31),
    float((int(vIndex) >> 10) & 31));

    vec3 vertexPos = cubePos - 16.0;

    vec2 quad = vec2(
    float(int(mTex * 2.0) & 1),
    float(int(mTex * 4.0) & 1)
    );
    //either 0,0; 0,1; 1,1; 1,0


    float eleVertEdge = (eleEV*0.25);




    vec3 mm = vec3(float(int(mVertNumQuarters * qpm.x) & 1),
    float(int(mVertNumQuarters * qpm.y) & 1),
    float(int(mVertNumQuarters * qpm.z) & 1));




    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));

    //if(sideId == 2 && quad.x == 0.0 && quad.y == 0.0){
    // vertexPos.x += slerp(vec3(0,1,1), vec3(1,1,1), (cubePos.x-7.0)/16.0).x;
    //}

    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);

    if(oreOverlayE > 0.0){
    gl_TexCoord[2].st = vec2(vcord.x + 0.0625 * mod((oreOverlayE - 1.0), 16.0), vcord.y + 0.0625 * (oreOverlayStartingRow + floor((oreOverlayE-1.0) * 0.0625))); //floor(oreOverlayE/16);
    }else{
    gl_TexCoord[2].st = vec2(0.9);
    }
    if(hitPointsE > 0.0){
    gl_TexCoord[1].st = vec2(vcord.x + 0.0625 * (hitPointsE - 1.0), vcord.y); //hit ovelays are in the first row
    }else{
    gl_TexCoord[1].st = vec2(0.9);
    }


    gl_TexCoord[0].st = vec2( texCoords.x + tiling * xIndex, texCoords.y + tiling * yIndex);




    gl_TexCoord[0].st += adip;
    gl_TexCoord[1].st += adip;
    gl_TexCoord[2].st += adip;

    //note: this is a directional light!
    lightDir = normalize(gl_LightSource[0].position.xyz);




    normalVec = normalize(gl_NormalMatrix * normal);
    viewDirection = -vPos.xyz;

    //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 =
    [2016-07-25 19:53:57] 0.0;
    }
    }

    vertexLight = vertexLightFunc(normalVec, lightDir, vPos.xyz, viewDirection, occlusion);
    gl_Position = gl_ProjectionMatrix * vPos;


    }

    [2016-07-25 19:53:57] [SHADER] ERROR COMPILING VERTEX SHADER data//shader/cube/quads13/cube-3rd.vsh STATUS: 0
    [2016-07-25 19:53:57] LOG: Vertex shader failed to compile with the following errors:
    ERROR: 0:5: error(#133) Reserved word: in
    ERROR: error(#273) 1 compilation errors. No code generated


    [2016-07-25 19:53:57] org.schema.schine.graphicsengine.shader.ShaderException:
    data//shader/cube/quads13/cube-3rd.vsh

    Vertex shader failed to compile with the following errors:
    ERROR: 0:5: error(#133) Reserved word: in
    ERROR: error(#273) 1 compilation errors. No code generated



    [2016-07-25 19:53:57] at obfuscated.aHq.a(SourceFile:340)
    [2016-07-25 19:53:57] at obfuscated.aHq.b(SourceFile:195)
    [2016-07-25 19:53:57] at obfuscated.aHq.<init>(SourceFile:116)
    [2016-07-25 19:53:57] at obfuscated.aHu.<init>(SourceFile:909)
    [2016-07-25 19:53:57] at obfuscated.aHr.a(SourceFile:906)
    [2016-07-25 19:53:57] at obfuscated.aHr.b(SourceFile:444)
    [2016-07-25 19:53:57] at obfuscated.hn.d(SourceFile:421)
    [2016-07-25 19:53:57] at obfuscated.hn.e_(SourceFile:325)
    [2016-07-25 19:53:57] at obfuscated.ayR.g(SourceFile:533)
    [2016-07-25 19:53:57] at obfuscated.ayR.a(SourceFile:701)
    [2016-07-25 19:53:57] at obfuscated.ayX.b(SourceFile:626)
    [2016-07-25 19:53:57] at obfuscated.Q.e(SourceFile:907)
    [2016-07-25 19:53:57] at org.schema.game.common.Starter.startMainMenu(SourceFile:1151)
    [2016-07-25 19:53:57] at org.schema.game.common.Starter.main(SourceFile:944)
    [2016-07-25 19:53:57] java.lang.RuntimeException: org.schema.schine.graphicsengine.shader.ShaderException:
    data//shader/cube/quads13/cube-3rd.vsh
    Running on thread: main
    Adapter: aticfx64
    Driver Version: 8.17.10.1460
    Vendor: ATI Technologies Inc.
    OpenGL Version: 4.5.13441 Compatibility Profile Context 16.200.1035.1001
    Renderer: AMD Radeon HD 7800 Series
    GLSL Ver: 4.50
     

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    v0.198.485 is the current release build, what you are playing is the current dev build.

    That aside it looks like this is the dev's end of things for a problem. That said they need all the help they can get in reporting these bugs. :)
     
    Joined
    Jun 24, 2013
    Messages
    270
    Reaction score
    43
    Yeah... I'm reporting it both in game and on forum. ;)

    So, I am able to get past the error by changing the shader code to:

    \data\shader\cube\quads13\cube-3rd.vsh
    Code:
    #IFDEF INTATT
        varying ivec4 ivert;
    #ENDIF
    But I suspect that's completely wrong because the game loads up and I have no visible blocks whatsoever.