Resolve conflicts
commit
477e1437d2
@ -0,0 +1,42 @@
|
|||||||
|
# use the official gcc image, based on debian
|
||||||
|
# can use verions as well, like gcc:5.2
|
||||||
|
# see https://hub.docker.com/_/gcc/
|
||||||
|
image: gcc
|
||||||
|
|
||||||
|
cache:
|
||||||
|
key: apt-cache
|
||||||
|
paths:
|
||||||
|
- apt-cache/
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
|
||||||
|
- apt-get update -yq
|
||||||
|
- apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libsdl2-dev libqt4-dev libopenal-dev libopenscenegraph-3.4-dev libunshield-dev libtinyxml-dev
|
||||||
|
# - apt-get install -y libmygui-dev libbullet-dev # to be updated to latest below because stretch is too old
|
||||||
|
- curl http://ftp.us.debian.org/debian/pool/main/b/bullet/libbullet-dev_2.87+dfsg-2_amd64.deb -o libbullet-dev_2.87+dfsg-2_amd64.deb
|
||||||
|
- curl http://ftp.us.debian.org/debian/pool/main/b/bullet/libbullet2.87_2.87+dfsg-2_amd64.deb -o libbullet2.87_2.87+dfsg-2_amd64.deb
|
||||||
|
- curl http://ftp.us.debian.org/debian/pool/main/m/mygui/libmygui.openglplatform0debian1v5_3.2.2+dfsg-1_amd64.deb -o libmygui.openglplatform0debian1v5_3.2.2+dfsg-1_amd64.deb
|
||||||
|
- curl http://ftp.us.debian.org/debian/pool/main/m/mygui/libmyguiengine3debian1v5_3.2.2+dfsg-1_amd64.deb -o libmyguiengine3debian1v5_3.2.2+dfsg-1_amd64.deb
|
||||||
|
- curl http://ftp.us.debian.org/debian/pool/main/m/mygui/libmygui-dev_3.2.2+dfsg-1_amd64.deb -o libmygui-dev_3.2.2+dfsg-1_amd64.deb
|
||||||
|
- dpkg --ignore-depends=libmygui.ogreplatform0debian1v5 -i *.deb
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- cores_to_use=$((`nproc`-2)); if (( $cores_to_use < 1 )); then cores_to_use=1; fi
|
||||||
|
- mkdir build; cd build; cmake -DCMAKE_BUILD_TYPE=MinSizeRel ../
|
||||||
|
- make -j$cores_to_use
|
||||||
|
- DESTDIR=artifacts make install
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- build/artifacts/
|
||||||
|
# depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- "*.o"
|
||||||
|
|
||||||
|
# TODO: run tests using the binary built before
|
||||||
|
#test:
|
||||||
|
# stage: test
|
||||||
|
# script:
|
||||||
|
# - ls
|
@ -0,0 +1,52 @@
|
|||||||
|
#version 120
|
||||||
|
|
||||||
|
varying vec2 uv;
|
||||||
|
uniform samplerCube cubeMap;
|
||||||
|
uniform int mapping;
|
||||||
|
|
||||||
|
#define PI 3.1415926535
|
||||||
|
|
||||||
|
vec3 sphericalCoords(vec2 coords)
|
||||||
|
{
|
||||||
|
coords.x = -1 * coords.x * 2 * PI;
|
||||||
|
coords.y = (coords.y - 0.5) * PI;
|
||||||
|
|
||||||
|
vec3 result = vec3(0.0,cos(coords.y),sin(coords.y));
|
||||||
|
result = vec3(cos(coords.x) * result.y,sin(coords.x) * result.y,result.z);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 cylindricalCoords(vec2 coords)
|
||||||
|
{
|
||||||
|
return normalize(vec3(cos(-1 * coords.x * 2 * PI),sin(-1 * coords.x * 2 * PI),coords.y * 2.0 - 1.0));
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 planetCoords(vec2 coords)
|
||||||
|
{
|
||||||
|
vec2 fromCenter = coords - vec2(0.5,0.5);
|
||||||
|
|
||||||
|
float magnitude = length(fromCenter);
|
||||||
|
|
||||||
|
fromCenter = normalize(fromCenter);
|
||||||
|
|
||||||
|
float dotProduct = dot(fromCenter,vec2(0.0,1.0));
|
||||||
|
|
||||||
|
coords.x = coords.x > 0.5 ? 0.5 - (dotProduct + 1.0) / 4.0 : 0.5 + (dotProduct + 1.0) / 4.0;
|
||||||
|
coords.y = max(0.0,1.0 - pow(magnitude / 0.5,0.5));
|
||||||
|
return sphericalCoords(coords);
|
||||||
|
}
|
||||||
|
|
||||||
|
void main(void)
|
||||||
|
{
|
||||||
|
vec3 c;
|
||||||
|
|
||||||
|
if (mapping == 0)
|
||||||
|
c = sphericalCoords(uv);
|
||||||
|
else if (mapping == 1)
|
||||||
|
c = cylindricalCoords(uv);
|
||||||
|
else
|
||||||
|
c = planetCoords(uv);
|
||||||
|
|
||||||
|
gl_FragData[0] = textureCube(cubeMap,c);
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
#version 120
|
||||||
|
|
||||||
|
varying vec2 uv;
|
||||||
|
|
||||||
|
void main(void)
|
||||||
|
{
|
||||||
|
gl_Position = gl_Vertex;
|
||||||
|
uv = (gl_Vertex.xy * vec2(1.0,-1.0) + vec2(1.0)) / 2;
|
||||||
|
}
|
Loading…
Reference in New Issue