1 // This file has been automatically generated from resource file src/Shaders/PBREnvBaking.vs
3 static const char Shaders_PBREnvBaking_vs[] =
4 "THE_SHADER_OUT vec3 ViewDirection; //!< direction of fetching from environment cubemap\n"
6 "uniform int uCurrentSide; //!< current side of cubemap\n"
7 "uniform int uYCoeff; //!< coefficient of Y controlling horizontal flip of cubemap\n"
8 "uniform int uZCoeff; //!< coefficient of Z controlling vertical flip of cubemap\n"
14 " if (uCurrentSide == 0)\n"
16 " aCoord = mat2( 0,-1,-1, 0) * occVertex.xy;\n"
18 " aDir.y = aCoord.x;\n"
19 " aDir.z = aCoord.y;\n"
21 " else if (uCurrentSide == 1)\n"
23 " aCoord = mat2( 0, 1,-1, 0) * occVertex.xy;\n"
25 " aDir.y = aCoord.x;\n"
26 " aDir.z = aCoord.y;\n"
28 " else if (uCurrentSide == 2)\n"
30 " aCoord = mat2( 0, 1, 1, 0) * occVertex.xy;\n"
31 " aDir.x = aCoord.y;\n"
33 " aDir.z = aCoord.x;\n"
35 " else if (uCurrentSide == 3)\n"
37 " aCoord = mat2( 0, 1,-1, 0) * occVertex.xy;\n"
38 " aDir.x = aCoord.y;\n"
40 " aDir.z = aCoord.x;\n"
42 " else if (uCurrentSide == 4)\n"
44 " aCoord = mat2( 1, 0, 0,-1) * occVertex.xy;\n"
45 " aDir.x = aCoord.x;\n"
46 " aDir.y = aCoord.y;\n"
49 " else //if (uCurrentSide == 5)\n"
51 " aCoord = mat2(-1, 0, 0,-1) * occVertex.xy;\n"
52 " aDir.x = aCoord.x;\n"
53 " aDir.y = aCoord.y;\n"
56 " ViewDirection = cubemapVectorTransform (aDir, uYCoeff, uZCoeff);\n"
57 " gl_Position = vec4 (occVertex.xy, 0.0, 1.0);\n"