Author Topic: Peugeot-Onyx (concept car)  (Read 42674 times)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Peugeot-Onyx (concept car)
« Reply #75 on: January 18, 2018, 05:46:14 pm »
Patrice,

I think I'll now try and add the billboard code to our PPL and then I'll send the sources to you for sync'ing, OK?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #76 on: January 18, 2018, 06:52:39 pm »
I think i am done with the lighting material.

I can wait for your code for sycing, or i can send you my current version if you want to check color material.

I shall update the white paper documentation, before i forget what i have done...

I have also the final Tron version, but i shall post officially the new 3D models only after we have a stable version 2.00  ;)
(2 extra meshes, and a new mtl file with empty color setting ready to check the new meta)

Added:
Documentation has been updated
http://www.objreader.com/index.php?topic=2.msg2323#msg2323
« Last Edit: January 18, 2018, 09:40:44 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Peugeot-Onyx (concept car)
« Reply #77 on: January 18, 2018, 10:48:27 pm »
OK Patrice,

Here come the sources with the very basic implementation of Y-axis aligned cylindrical billboards.

Both FFP and PPL are supported. In fact, both pipelines now share one and the same immediate-mode billboard procedure. It should be fast enough as-is. At least, it features significantly fewer OpenGL function calls than a true GLSL geometric shader setup would require. :)

The #billboard meta now features an optional nodepth parameter that disables GL_DEPTH_TEST while drawing the billboard (or flare) quad. Sometimes it's very handy to draw e.g. elevated streetlamp flares unobscured by the surrounding foliage.

Use the following material with my Q3Flares model to see what I'm seeing in ObjReader and Objector now:

newmtl flame
#billboard nodepth
#alphatocoverage
  Ns 2
  d 0.99
  illum 2
  Kd 0 0 0
  Ka 0 0 0
  Ks 0 0 0
  Ke 1 1 1
  map_Kd flare.png


Try it also without the keyword nodepth in the #billboard statement. Use the flare image in the zip. (in fact the flare file is yours)

Enjoy and keep me informed. :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #78 on: January 19, 2018, 09:30:29 am »
Here is the merged version.

I have checked the new cylindrical biilboard, and that works great.
I think we should have more option to allow the exact replication of what i have done into my 3D Chart (to have the quads always facing the camera for the purpose of cheap spherical bubble effect). That would be also very handy to display a text legend.

About IPS/FPS, i am keeping the IPS wording, because of the specific refresh rate used in ObjReader, that is based on the low priority message WM_TIMER, and half the real display LCD refresh rate, giving a maximum IPS of 32-34 while in demo mode. This has been done by design to limit the CPU impact.

I shall post a new Tron project to let you play with the new light settings.

For the billboard options we could have:
- Flat (default, always facing the camera)
- Cylindrical (just like what you have done)
- Spherical

Your thought?

And thank you again for all your hard work to diagnose (and have solved) the billboard problem !!!


« Last Edit: January 19, 2018, 09:35:52 am by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #79 on: January 19, 2018, 01:46:38 pm »
Please add this to protect us from GPF

Unhandled exception at 0x00007FFEE6EA765C (ucrtbased.dll) in ObjReader64.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.
Quote
    _Check_return_opt_
    _CRT_STDIO_INLINE int __CRTDECL _vfscanf_l(
        _Inout_                       FILE*       const _Stream,
        _In_z_ _Printf_format_string_ char const* const _Format,
        _In_opt_                      _locale_t   const _Locale,
                                      va_list           _ArgList
        )
    #if defined _NO_CRT_STDIO_INLINE
    ;
    #else
    {
        return __stdio_common_vfscanf(
            _CRT_INTERNAL_LOCAL_SCANF_OPTIONS,
            _Stream, _Format, _Locale, _ArgList);
    }
    #endif


        case '#': // PAT: 01-07-2018 meta specific for material
            if (strcmp(szBuffer, "#alphatocoverage") == 0) {
                if (Mobj_AlphaToCoverage(0, 0) == 0) {
                    pMaterial->isA2C = -1;
                }
            } else if(strcmp(szBuffer, "#billboard") == 0) {
                pMaterial->isBillboard = -1;
                fgets(szBuffer, sizeof(szBuffer), pFile); // ML 01-18-2018: look for *optional* GL_DEPTH_TEST flag!
                CharLowerA(szBuffer);
                if (strstr(szBuffer, "nodepth") != 0) {
                    pMaterial->isBillboard = -2;
                } else {
                    fseek(pFile, -(long)strlen(szBuffer), SEEK_CUR); // ML 01-18-2018: rewind if no *such* flag found! If not
                }                                                    // rewound, fgets() may have chomped a meaningful keyword!
            } else {
                fgets(szBuffer, sizeof(szBuffer), pFile);
            }

            break;
« Last Edit: January 19, 2018, 01:50:30 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #80 on: January 19, 2018, 02:15:45 pm »
Mike

Could you check the new Mobj_SetLightColor()
I am not sure of the best way to setup and use the new macro...

When using lighting materials i would like that all the matching parameters be set to VISIBLE mode at startup.

Code: [Select]
void Mobj_SetLightColor() {
    BYTE a, r, g, b;
    DWORD dwStyle = 0;
    if (gP.frontall) {
        zSplitColorARGB(gP.frontall, a, r, g, b);
        gP.light0ColorAll = false;
        DOCOLORALL(0);
        DOLIGHTON(0, 1, 2);
        DOCOLORCHEAP(0);
    } else {
        if (gP.frontambient) {
            zSplitColorARGB(gP.frontambient, a, r, g, b);
            DOLIGHTON(0, 1, 2);
            SETCOLORAMB(0);
        }
        if (gP.frontdiffuse) {
            zSplitColorARGB(gP.frontdiffuse, a, r, g, b);
            DOLIGHTON(0, 1, 2);
            SETCOLORDIF(0);
        }
        if (gP.frontspecular) {
            zSplitColorARGB(gP.frontspecular, a, r, g, b);
            DOLIGHTON(0, 1, 2);
            SETCOLORSPEC(0);
        }
    }

    if (gP.leftall) {
        zSplitColorARGB(gP.leftall, a, r, g, b);
        gP.light1ColorAll = false;
        DOCOLORALL(1);
        DOLIGHTON(1, 0, 2);
        DOCOLORCHEAP(1);
    } else {
        if (gP.leftambient) {
            zSplitColorARGB(gP.leftambient, a, r, g, b);
            DOLIGHTON(1, 0, 2);
            SETCOLORAMB(1);
        }
        if (gP.leftdiffuse) {
            zSplitColorARGB(gP.leftdiffuse, a, r, g, b);
            DOLIGHTON(1, 0, 2);
            SETCOLORDIF(1);
        }
        if (gP.leftspecular) {
            zSplitColorARGB(gP.leftspecular, a, r, g, b);
            DOLIGHTON(1, 0, 2);
            SETCOLORSPEC(1);
        }
    }

    if (gP.rightall) {
        zSplitColorARGB(gP.rightall, a, r, g, b);
        gP.light2ColorAll = false;
        DOCOLORALL(2);
        DOLIGHTON(2, 0, 1);
        DOCOLORCHEAP(2);

    } else {
        if (gP.rightambient) {
            zSplitColorARGB(gP.rightambient, a, r, g, b);
            DOLIGHTON(2, 0, 1);
            SETCOLORAMB(2);
        }
        if (gP.rightdiffuse) {
            zSplitColorARGB(gP.rightdiffuse, a, r, g, b);
            DOLIGHTON(2, 0, 1);
            SETCOLORDIF(1);
        }
        if (gP.rightspecular) {
            zSplitColorARGB(gP.rightspecular, a, r, g, b);
            DOLIGHTON(2, 0, 1);
            SETCOLORSPEC(2);
        }
    }
}

« Last Edit: January 19, 2018, 02:18:45 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Peugeot-Onyx (concept car)
« Reply #81 on: January 19, 2018, 02:53:49 pm »
Thanks Patrice,

Merged successfully.

Re: GPF

Done as advised, thanks for the fix!

Re: billboards

Spherical billboards are the ones that are always facing the camera as your bubbles and more realistic light flares do; cylindrical ones are primarily meant to emulate distant vegetation and monsters. And yes, the spherical ones are also suitable to display dynamically moving text legends. These are going to be my next task. The #billboard statement syntax will be expanded accordingly.

Flat billboards are to be "torn" from their models at run time (view time) and glued flat and immobilized to the predefined screen coords, like your Onyx plate did in your first experiments. In fact, these are a kind of model's own HUDs that exist on the screen without the viewer's assistance or control. They will be the last ones to implement because they aren't our immediate necessity.

Re: Tron

It's a pity you haven't preloaded the #light metacommands with some initial values other than the default lighting. Yes, I can generate some acid colors myself but I can't do it as good as you do. :)

Re: IPS

Of course you're in your own right to take the final decision on your counter's implementation, mon ami. But doin't blame me when I'm referring to Fraps citing your ObjReader's official FPS rate at some future point in time. ;)

Re: thanks

It is my pleasure and honor to be working with you on this project. :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Peugeot-Onyx (concept car)
« Reply #82 on: January 19, 2018, 03:07:46 pm »
Re: Mobj_SetLightColor()

Frankly, I was planning to go out for a few hours. Can it wait till later in the evening? (we are here 3 hours ahead of your local time)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #83 on: January 19, 2018, 04:33:23 pm »
Quote
But doin't blame me when I'm referring to Fraps citing your ObjReader's official FPS rate at some future point in time

While in "Demo mode", the nVIDIA FPS and my IPS are almost identical, and on Windows 10 there is no FRAPS ;)
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #84 on: January 19, 2018, 05:14:43 pm »
I am slowly making my way to setup correctly the colors from the mtl file...

Here is the new Mobj_SetLightColor to use
Code: [Select]
void Mobj_SetLightColor() {
    BYTE a, r, g, b;
    DWORD dwStyle = 0;
    bool IsVisible = false;
    if (gP.frontall) {
        zSplitColorARGB(gP.frontall, a, r, g, b);
        IsVisible = true;
        DOCOLORCHEAP(0);
    } else {
        if (gP.frontambient) {
            zSplitColorARGB(gP.frontambient, a, r, g, b);
            IsVisible = true;
            SETCOLORAMB(0);
        }
        if (gP.frontdiffuse) {
            zSplitColorARGB(gP.frontdiffuse, a, r, g, b);
            IsVisible = true;
            SETCOLORDIF(0);
        }
        if (gP.frontspecular) {
            zSplitColorARGB(gP.frontspecular, a, r, g, b);
            IsVisible = true;
            SETCOLORSPEC(0);
        }
    }
    if (IsVisible) {
        gP.isLight0_On = IsVisible;
        CheckMenuItem(gP.hLight0Menu, MENU_LIGHT0_ON, MF_CHECKED);
        gP.nLightFlags |= (1 << (0)); /* bin 001, 010, or 100 ==> dec 1, 2, or 4 ==> (1 << (0)) */
    }

    if (gP.leftall) {
        zSplitColorARGB(gP.leftall, a, r, g, b);
        gP.light1ColorAll = false;
        DOCOLORALL(1);
        DOLIGHTON(1, 0, 2);
        DOCOLORCHEAP(1);
    } else {
        if (gP.leftambient) {
            zSplitColorARGB(gP.leftambient, a, r, g, b);
            DOLIGHTON(1, 0, 2);
            SETCOLORAMB(1);
        }
        if (gP.leftdiffuse) {
            zSplitColorARGB(gP.leftdiffuse, a, r, g, b);
            DOLIGHTON(1, 0, 2);
            SETCOLORDIF(1);
        }
        if (gP.leftspecular) {
            zSplitColorARGB(gP.leftspecular, a, r, g, b);
            DOLIGHTON(1, 0, 2);
            SETCOLORSPEC(1);
        }
    }

    if (gP.rightall) {
        zSplitColorARGB(gP.rightall, a, r, g, b);
        gP.light2ColorAll = false;
        DOCOLORALL(2);
        DOLIGHTON(2, 0, 1);
        DOCOLORCHEAP(2);
    } else {
        if (gP.rightambient) {
            zSplitColorARGB(gP.rightambient, a, r, g, b);
            DOLIGHTON(2, 0, 1);
            SETCOLORAMB(2);
        }
        if (gP.rightdiffuse) {
            zSplitColorARGB(gP.rightdiffuse, a, r, g, b);
            DOLIGHTON(2, 0, 1);
            SETCOLORDIF(2);
        }
        if (gP.rightspecular) {
            zSplitColorARGB(gP.rightspecular, a, r, g, b);
            DOLIGHTON(2, 0, 1);
            SETCOLORSPEC(2);
        }
    }
}
« Last Edit: January 19, 2018, 05:22:16 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Peugeot-Onyx (concept car)
« Reply #85 on: January 20, 2018, 04:03:57 am »
If you tell me again you don't want such beautiful emissive boosters for your Ramjet, I am not going to believe you. ;)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)