mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-23 08:44:07 +00:00
ray:: reflective walls (turned off)
This commit is contained in:
parent
ee06fdc326
commit
deb98cba7f
@ -106,6 +106,8 @@ void reset_raycaster() { our_raycaster = nullptr; };
|
|||||||
|
|
||||||
void enable_raycaster() {
|
void enable_raycaster() {
|
||||||
if(!our_raycaster) {
|
if(!our_raycaster) {
|
||||||
|
bool use_reflect = false;
|
||||||
|
|
||||||
string vsh =
|
string vsh =
|
||||||
"attribute vec4 aPosition;\n"
|
"attribute vec4 aPosition;\n"
|
||||||
"uniform float uFovX, uFovY;\n"
|
"uniform float uFovX, uFovY;\n"
|
||||||
@ -302,6 +304,9 @@ void enable_raycaster() {
|
|||||||
"vec4 acc2 = christoffel(pos2, tan2, tan2);\n"
|
"vec4 acc2 = christoffel(pos2, tan2, tan2);\n"
|
||||||
"vec4 nposition = position + tangent * dist + acc2 / 2. * dist * dist;\n";
|
"vec4 nposition = position + tangent * dist + acc2 / 2. * dist * dist;\n";
|
||||||
|
|
||||||
|
if(use_reflect) fmain +=
|
||||||
|
"bool reflect = false;\n";
|
||||||
|
|
||||||
if(nil) {
|
if(nil) {
|
||||||
fmain +=
|
fmain +=
|
||||||
"vec4 xp, xt;\n"
|
"vec4 xp, xt;\n"
|
||||||
@ -407,6 +412,12 @@ void enable_raycaster() {
|
|||||||
if(nil) fmain +=
|
if(nil) fmain +=
|
||||||
" if(abs(abs(position.x)-abs(position.y)) < .005) col.xyz /= 2.;\n";
|
" if(abs(abs(position.x)-abs(position.y)) < .005) col.xyz /= 2.;\n";
|
||||||
|
|
||||||
|
if(use_reflect) fmain +=
|
||||||
|
" if(col.w == 1.) {\n"
|
||||||
|
" col.w = 0.9;\n"
|
||||||
|
" reflect = true;\n"
|
||||||
|
" }\n";
|
||||||
|
|
||||||
fmain +=
|
fmain +=
|
||||||
" gl_FragColor.xyz += left * col.xyz * col.w;\n"
|
" gl_FragColor.xyz += left * col.xyz * col.w;\n"
|
||||||
" if(col.w == 1.) return;\n"
|
" if(col.w == 1.) return;\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user