The following warnings occurred:
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.3.6 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/printthread.php(287) : eval()'d code 2 errorHandler->error_callback
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



AssaultCube Reloaded Forums
Night play? - Printable Version

+- AssaultCube Reloaded Forums (https://acrf.victorz.ca)
+-- Forum: Gameplay (https://acrf.victorz.ca/forum-3.html)
+--- Forum: Gameplay Discussion (https://acrf.victorz.ca/forum-12.html)
+--- Thread: Night play? (/thread-1252.html)

Pages: 1 2 3 4


RE: Night play? - rXn - 2014-02-23

Here's the final texture load code:
Code:
//somewhere outside the function
static void change_nv = 0;
//...
//In gl_drawhud()
     if(nightvision) {
        glEnable(GL_TEXTURE_2D);
        static Texture *nvtex = textureload("packages/misc/nv1.png", 3);
        static Texture *nvtex2 = textureload("packages/misc/nv2.png", 3);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        if((lastmillis - change_nv) < 50) {
            glBindTexture(GL_TEXTURE_2D, nvtex->id);
        } else {
            change_nv = lastmillis;
            glBindTexture(GL_TEXTURE_2D, nvtex2->id);
        }
        glColor4f(1, 1, 1,1);
        glBegin(GL_QUADS);
            glTexCoord2f(0, 0); glVertex2f(0, 0);
            glTexCoord2f(1, 0); glVertex2f(VIRTW, 0);
            glTexCoord2f(1, 1); glVertex2f(VIRTW, VIRTH);
            glTexCoord2f(0, 1); glVertex2f(0, VIRTH);
        glEnd();
     }
and the fog code:
Code:
//Best in gl_drawframe() behind the water stuff, but put it whereever you want.
    if(nightvision) {

        glFogfv(GL_FOG_COLOR, nfogc);
        glFogi(GL_FOG_START, 0);
        glFogi(GL_FOG_END, 30);
    }

For now it is flickering quite fast and I am not responsible for any monitor damage or mental diseases that might result of it...

Here are the images nv1.png and nv2.png:
[Image: GeEK49P.png]
[Image: Vvz7LiH.png]

They are basically the same, but one is moved one pixel up so when they are loaded one by one they flicker nicely (insanely? Tongue)


RE: Night play? - {KE}Agent 1007 - 2014-02-27

Sounds awesome! Thanks for the work on that! When I get a chance, I'll test it out (if I can figure out how to Tongue )


RE: Night play? - rXn - 2014-02-28

I'll upload a compilable version, wait a second...

It is uploaded to http://armory.icyboards.net/showthread.php?tid=7. To install extract in your ACR folder and recompile (Linux/gcc: make client && make install).


RE: Night play? - -{ET}-xdEpicZombie - 2014-02-28

Um how should I install it in Windows?

PS @rXn I made You an admin in Armory!


This forum uses Lukasz Tkacz MyBB addons.