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

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #30 on: January 08, 2018, 10:56:52 am »
I can see all the potential to get better accurate lighting to match the default wallpaper background.

I did duplicate the light menu onto the main menu bar, for easiest selection.
« Last Edit: January 08, 2018, 12:00:06 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 #31 on: January 08, 2018, 01:30:37 pm »
Excellent! :)

To watch your Onyx headlights glow in the dark, start with the following material definition, switch off 'Multiple light sources', and dim the scene illumination to ca. 20%: (see screenshot)

newmtl glowing
Ke 0.15 0.35 0.95
map_Kd flare.png
Ns 512
d 0.9
illum 2


Now imagine the lights that are coded in the .MTL library with per-material #metacommands just like your A2C now is. The model is an elm tree alley late at night with a few stars in the sky; everything is lit very dimly with ambient-only GL_LIGHT0. On both sides of the alley, there are a few lampposts (a.k.a. street lights) whose top lamp meshes are made of a per-material GL_LIGHT0+1+2 #multilight material with a GL_EMISSION billboard flare in front of it! The scene is already giving me shivers and creeps even though Freddy Krueger is nowhere to be seen yet!!!  :D
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #32 on: January 08, 2018, 02:37:36 pm »
Mike---

Both WinLIFT and GDImage support negative ranges with scrollbar sliders, for example -50, 50 is a perfect value; 0 being the medium value.
This means we must use signed values, aka: HIINT not HIWORD.

I am stamped with my BillBoarding function, i must remember how to use it ;)
currently it is always facing the camera that is good, but i would like that it follows the whole rotation of the model for the purpose of the quad flare effect.

I shall send you the new build as soon as i have sorted out my billboard problem.


Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Peugeot-Onyx (concept car)
« Reply #33 on: January 08, 2018, 03:30:28 pm »
Illuminating (-/0/+), rather than the existing attenuating (0/100%), mode of scene brightness slider operation would be much, much more complicated to implement. Max values (255/255) of each color component of each amb/dif/spec property of a scene light would have to be monitored constantly in real time. Alternatively, brute force min/max clamping would have to be applied in each render frame to avoid overbrighting. Either way, the frame rate would suffer dramatically. I think the end result isn't worth the effort.

P.S. Please don't discard the camera front-facing billboard flare effect entirely! Make it a menu-selectable option!
« Last Edit: January 08, 2018, 03:34:39 pm by Michael Lobko-Lobanovsky »
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 #34 on: January 09, 2018, 06:32:09 am »
Patrice,

1. This ObjReader renders the IPS count for me in Win 7. That's good news. :)

2. The billboard function you're trying to use won't work in ObjReader. This hacker (!) function operates in object space coordinates (Objector's first-person shooter camera can use it) but ObjReader's current camera operates in world space coordinates. Some extra investigation is needed. That's neutral news.  ::)

3. I've found an extremely simple OBJ model without pre-calculated normals that crashes ObjReader badly. Objector loads it without problems. That's bad news.  :-\

P.S. Don't worry about the crash. The .OBJ file was invalid. It's just that FBSL is much more tolerant to memory issues because it has its own memory manager, which MS VC doesn't have. :)
« Last Edit: January 09, 2018, 09:50:28 am by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #35 on: January 09, 2018, 10:33:03 am »
Mike,

OK thank you for the feedback.

The IPS thing, never changed from the time of BassBox, i couldn't understand why it was not working by you on Seven  :-\

For the billboard thing, i have used the same code than in my SkinChart project, except that i am creating myself the billboarded point into GL_ChartPoint this way.

Code: [Select]
void CircleTable (OUT vector<float> &sint, OUT vector<float> &cost, IN long n) {
    // Table size, the sign of n flips the circle direction.
    long nSize = abs(n);
    // Determine the dAngle between samples.
    double dAngle;
    if (n == 0) { n = 1; }
    dAngle = 2.0f * PI / (float) n;
    // Allocate memory for n samples, plus duplicate of first entry at the end.
    sint.resize(nSize+1);
    cost.resize(nSize+1);
    // Compute cos and sin around the circle.
    sint[0] = 0.0f;
    cost[0] = 1.0f;
    for (long nI = 1; nI < nSize; nI++) {
       sint[nI] = (float) sin(dAngle * nI);
       cost[nI] = (float) cos(dAngle * nI);
    }
    // Last sample is duplicate of the first.
    sint[nSize] = sint[0];
    cost[nSize] = cost[0];
}

void GL_BillBoard () { // dllexport
    // Create MultMatrix
    float mm[16] = {1.0f, 0.0f, 0.0f, 0.0f,
                    0.0f, 1.0f, 0.0f, 0.0f,
                    0.0f, 0.0f, 1.0f, 0.0f,
                    0.0f, 0.0f, 0.0f, 1.0f};

    float m[16]; glGetFloatv(GL_MODELVIEW_MATRIX, &m[0]);
    // Convert to OpenGL matrix notation
    mm[0] = m[0];
    mm[1] = m[4];
    mm[2] = m[8];
    mm[4] = m[1];
    mm[5] = m[5];
    mm[6] = m[9];
    mm[8] = m[2];
    mm[9] = m[6];
    mm[10] = m[10];
    glMultMatrixf(&mm[0]);
}

void GL_ChartPoint (IN float Radius, IN float rValue) { // dllexport
    glPushMatrix();
       glTranslatef(0, rValue, 0);
       long nJ;
       // Pre-computed circle.
       static long nDone;
       static vector<float> sint;
       static vector<float> cost;
       if (nDone == 0) { nDone = -1; CircleTable(sint, cost, -32); }

       // Always show it in front of the camera.
       GL_BillBoard();

       glBegin(GL_TRIANGLE_FAN);
          glNormal3f(0.0f, 0.0f, 1.0f);
          glTexCoord2f(0.5f, 0.5f);
          for (nJ = 32; nJ > -1; nJ--) {
             glTexCoord2f((cost[nJ] + 1) * 0.5f , (sint[nJ] + 1.0f) * 0.5f);
             glVertex3f(cost[nJ] * Radius, sint[nJ] * Radius, 0.0f);
          }
       glEnd();
    glPopMatrix();
}

Added:
We must reset the lighting when loading a new model (see the attachment).
« Last Edit: January 09, 2018, 07:35:30 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 #36 on: January 10, 2018, 02:29:18 am »
I think that the front light looks gorgeous  8)

Terrrrrrrriblement terrrrrrrrific!!! :D


I got the billboard flare basically working and am now experimenting a bit more to see if various other billboard types may be of use in ObjReader/Objector. :)
« Last Edit: January 10, 2018, 02:31:11 am by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #37 on: January 10, 2018, 11:47:01 am »
Quote
I got the billboard flare basically working and am now experimenting a bit more to see if various other billboard types may be of use in ObjReader/Objector. :)

That is great!

Would be nice if it could work like in
http://www.objreader.com/index.php?topic=17.0

I also thought of an individual mesh billboarded rotation (gauge, clock, air jet spirale cone effect, etc.).

And with the latest feature another global #straylight % meta, to setup the default brightness percentage when loading a model.
BTW i changed the IDC_BRIGHT_CONTROL tooltip wording to "  Stray light  ", and reverted the slider orientation.  ;)

I am thinking also about a new auto-hide composited control panel, like in MediaBox when playing the plugins full screen.

See a slight Ke emission applyed to the tachymeter, and the new slider orientation...



« Last Edit: January 10, 2018, 01:54:57 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 #38 on: January 10, 2018, 03:41:20 pm »
And with the latest feature another global #straylight % meta, to setup the default brightness percentage when loading a model.
BTW i changed the IDC_BRIGHT_CONTROL tooltip wording to "  Stray light  ", and reverted the slider orientation.  ;)

Great! :)

Quote
I am thinking also about a new auto-hide composited control panel, like in MediaBox when playing the plugins full screen.

Nice!! :)

Quote
See a slight Ke emission applyed to the tachymeter, and the new slider orientation...

Awesome!!! 8)
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 #39 on: January 10, 2018, 06:21:26 pm »
Your 3DChart has become extremely attractive in recent years. :) No z-buffer fighting on the ground plane any more. :)

Now, exactly what is your rValue in your GL_ChartPoint (IN float Radius, IN float rValue)? I guess it must be the Y height of sprite center relative to the world center [0,0,0]. What are the actual limits of rValue in some absolute units or per cent of something?

Yes, I'd like to have any models you create. When I'm through with billboards, I'll also send you my Quake III torch models I'm using to test flares. :)


P.S. Re: "  Stray light  "

I think you could also call it "Light dimmer" or "fader".
« Last Edit: January 10, 2018, 06:29:42 pm by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #40 on: January 10, 2018, 06:57:15 pm »
As far as i can remember, in 3D Chart, the rValue must match the edge scale.  ;)

I am preparing the wip with the extra mesh, and the specific mtl file.

BTW i like fader because the word is short, however 100% means maximum brightness intensity (the current value), while zero is total darkness (this is the reason why i used "stray light"). Of course nothing is in concrete, so we can change the #straylight meta for something better.

« Last Edit: January 10, 2018, 07:00:15 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #41 on: January 10, 2018, 07:15:08 pm »
wip.zip = extra mesh + new mtl file (with new Ke settings)

Main_Mobj.zip = my latest work on meta and slider values.

note:
The static Mobj_ functions, are a survival of the Mobj.dll version.

But now with the current status of ObjReader, we could use a specific set of global properties to setup the GLOBAL mesh settings that must be restored to the .mtl settings.

Quote
I'll also send you my Quake III torch models I'm using to test flares. :)
I couldn't find it  :-[

After looking again at my 3D Chart, it becomes obvious that we must use translation in the ObReader billboard.
In charting for obvious reasons the 0,0 origine is like in the 2d world to help the users that are not familiar with world coordinates, i forgot this myself  ::)

See this
https://opengameart.org/content/lens-flares-and-particles
you can use any of them to replace the OR.png file


« Last Edit: January 10, 2018, 07:46: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 #42 on: January 10, 2018, 08:10:37 pm »
wip.zip = extra mesh + new mtl file (with new Ke settings)

Main_Mobj.zip = my latest work on meta and slider values.

Downloading now, thanks!

Quote
... we could use a specific set of global properties to setup the GLOBAL mesh settings that must be restored to the .mtl settings.

Probably yes, we even should. Many of them are used directly in our render procs where every millisecond, if not microsecond, counts. We certainly need no extra function call overhead there.

Quote
Quote
I'll also send you my Quake III torch models I'm using to test flares. :)
I couldn't find it  :-[

I said:
Quote
When I'm through with billboards...
which I am not as of yet. :) Anyway, the models are attached below. :)

Quote
See this https://opengameart.org/content/lens-flares-and-particles you can use any of them to replace the OR.png file

Thank you for the link! :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Peugeot-Onyx (concept car)
« Reply #43 on: January 11, 2018, 10:50:54 pm »
I could spend hours playing with the new settings, and trying to make the best mtl file.  ::)

I am thinking of a new global meta #background to be used like #wallpaper but using a specific texture materiel exclusive to the model.
« Last Edit: January 11, 2018, 10:57:20 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 #44 on: January 12, 2018, 12:38:16 am »
Re: spending hours



BTW you didn't tell me whether you do have a skinnable color picker among your stock of skinned widgets...

Re: #wallpaper vs. #background

Technically speaking, a #wallpaper is a material of sorts; it is in fact a diffuse-only textured quad made of otherwise default material. The only difference it makes is that its vertices are generated on the fly at run time rather than form part of the static model loaded for rendering.

Re: flares

Similar to #wallpaper, what you do with your 3D chart bubbles and what we should do with the flare meshes in the model is that we shouldn't have them defined, or shouldn't regard, as literal part of the model. We should generate their quads on the fly and draw them in the orthogonal, rather than modelview, projection.

Theoretically, it's possible to reposition and un-rotate the model and draw its flare(s) independently and then restore the entire model's position and rotation, but that would be one hell of a lot of work to be done, and time, to lose.

It would be much, much more reasonable to just draw the flare quad separately from the model bypassing its vertex array that's already loaded on the GPU because drawing just a quad in the orthogonal projection the way we draw a #wallpaper is way faster than messing with the entire model.

It is easy to un-rotate the flare that's positioned at the model's center. But it's a PITA to unwind and then rewind the model's entire geo for the sake of just one quad of four vertices when the flare is far off of the model center of origin.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)