Author Topic: Early WIP on v2.55  (Read 140519 times)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #150 on: November 09, 2018, 09:04:20 pm »
OK I got your point Patrice,

So now we have Windows tooltip automation no more... ::)

Never mind, your fix (or rather rollback) is working perfectly fine for me. :)

I just moved the value labels to xOffset = 100 because the parameter names (captions) are going to change dynamically depending on the shader and I want to avoid having to move the labels manually based on the name lengths.

I also made the labels 50 px wide and changed the tooltip and value label formats to %2.3f because those are shader parameters and everything in GLSL has at least half-float (three decimal digits) precision.

You've done a great job and may now "rest in peace" till you get completely well. :)

But don't forget to send me your official WinLIFT VS2010 libs first!

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

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #151 on: November 10, 2018, 10:14:53 am »
What do you mean by static one?

For the ToolWindow, here is what to do to compute the correct xOffset, and display the IDT_VALUExx at the right location, rather than a fixed one.

long stW = 0, stH = 0;
WCHAR zFont[MAX_PATH]; ClearMemory(zFont, sizeof(zFont));
Path_Combine(zFont, skSkinFolder(), L"trebuc.ttf");
WCHAR zTxt[MAX_PATH]; ClearMemory(zTxt, sizeof(zTxt));
GetWindowText(GetDlgItem(hWnd, IDT_CAPTION02), zTxt, strSize(zTxt));
ZD_GetTextBound(zTxt,           // The related string
                zFont,          // The TrueType font name
                14,             // The size of the font being used in pixel
                stW,            // Get the bounding width
                stH,            // Get the bounding height
                ZD_TextHorzUp); // We use horizontal orientation
« Last Edit: November 10, 2018, 11:04:39 am by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #152 on: November 10, 2018, 11:06:06 am »
BTW are there any help files for the GDImage and WinLIFT libraries?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #153 on: November 10, 2018, 11:26:51 am »
Quote
Isn't that a bit too much for a 3rd-rate feature that will eventually be moved into the existing/additional overlay window?
This was also to let you know, how to use the existing pandora API for that purpose.

I have attached the missing .lib (i thought it was already in the previous zip)

And 2 chm help files for WinLIFT and GDImage (for the 32-bit version, but the 64-bit API names are the same)
« Last Edit: November 10, 2018, 12:26:48 pm by Michael Lobko-Lobanovsky »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #154 on: November 10, 2018, 12:50:36 pm »
Thank you ever so much Patrice!

How are you feeling today? We've got 0oC with fog and wind here and 100% humidity but we've seen no snow so far. That's the worst weather possible for my arteries, and I'm aching all over. :(

Quote
... i thought it was already in the previous zip ...

No, the zip contained the DLL only. I guess both libraries are regenerated when a WinLIFT/GDImage build is recompiled, so to keep them ABI compatible we should reinstall both of them after each recompilation.
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: Early WIP on v2.55
« Reply #155 on: November 10, 2018, 01:08:44 pm »
Does your trebuc.ttf in the \Reader subfolder differ from the Trebuchet MS font that's installed under my Win 7 natively?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #156 on: November 10, 2018, 01:20:59 pm »
Quote
How are you feeling today?
After an horrible night, i feel a little better now with the help of a "tea tree" fumigation.

Quote
That's the worst weather possible for my arteries, and I'm aching all over.
My friend you have my compassion.
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #157 on: November 10, 2018, 01:27:07 pm »
Quote
Does your trebuc.ttf in the \Reader subfolder differ from the Trebuchet MS font that's installed under my Win 7 natively?
I couldn't say, but the use of a private font, is the garantie that the look of the interface is always the same from one computer/OS version to another.
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #158 on: November 10, 2018, 10:33:53 pm »
Re. Mark17:

Contemporary rendering engines usually store grayscale luminance texture maps (AO/cavity, specular/shadow, gloss/roughness/metalness, height/displacement) in individual color/alpha channels of common multipurpose 32-bit textures. This way they improve 4x on both the texture size in VRAM and the time it takes to mipmap huge contemporary 4Kx4K and 8Kx8K texture atlases.

How would you suggest they store your bluish chrome_AO.png in their paradigm? ;)

(What you really need here is effectively called a colored light map -- an opposite to the grayscale AO/shadow map.)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #159 on: November 10, 2018, 10:45:29 pm »
Currently, i am doing the best of what i can do, with what is on my disposal ;)

Here is another example of altered AO to produce the attached screen shot...
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #160 on: November 10, 2018, 10:53:53 pm »
In Blender, you can bake the AO and/or light map directly into the mesh diffuse texture thus sparing a huge amount of model loading time and video memory.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #161 on: November 11, 2018, 07:51:28 pm »
Ok, i found the error, the antialias that was used in skDrawTextToDC is incorrect.

Try with this

void skDrawTextToDC(IN HDC hDC, IN wstring sTxt, RECT rb, IN long nItem, IN LONG_PTR nStrFormat) {
    if (nItem > -1) {
        RECTF rcLayout;
        LONG_PTR nFontToUse = 0, graphics = 0, nFam = 0, nBrush = 0;
        // Create matching font
        nFam = g_Child[nItem].PrivateFont;
        if (nFam == 0) { GdipCreateFontFamilyFromName(g_Child[nItem].fontName, 0, nFam); }
        if (nFam) {
           GdipCreateFont(nFam, g_Child[nItem].fontSize, g_Child[nItem].fontStyle, 2, nFontToUse);
           if (nFontToUse) {
               if (skGetSystemMetrics(SK_OUTER_GLOW)) { BlurTextPlus(hDC, (WCHAR*) sTxt.c_str(), rb, nFontToUse, nStrFormat); }
               if (GdipCreateFromHDC(hDC, graphics) == 0) {
                   rcLayout.left   = (float) rb.left;
                   rcLayout.top    = (float) rb.top;
                   rcLayout.right  = (float) rb.right - rb.left;
                   rcLayout.bottom = (float) rb.bottom - rb.top;
                   //GdipSetTextRenderingHint(graphics, TextRenderingHintAntiAliasGridFit); // wrong antialias
                   GdipSetTextRenderingHint(graphics, TextRenderingHintAntiAlias);
     
                   if (GdipCreateSolidFill(g_Child[nItem].fontColor, nBrush) == 0) {
                       GdipDrawString(graphics, sTxt, (long) sTxt.length(), nFontToUse, rcLayout, nStrFormat, nBrush);
                       GdipDeleteBrush(nBrush);
                   }
                   GdipDeleteGraphics(graphics);
               }
               GdipDeleteFont(nFontToUse); // Delete the font object
           }
           if (g_Child[nItem].PrivateFont == 0) { GdipDeleteFontFamily(nFam); }    // Delete the font family object
        }
    }
}


Check with this change and tell me how it goes.
« Last Edit: November 11, 2018, 07:54:11 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #162 on: November 11, 2018, 11:24:21 pm »
Thanks for the good job, Patrice! :)
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: Early WIP on v2.55
« Reply #163 on: November 12, 2018, 04:23:30 pm »
OK Patrice,

I want you to get well sooner, and to this end, I'm going to increase your interest in life.

Here are my mods that add run time controls to the fancy shaders. Now you'll be able to inspect your patients under much higher quality adjustable X-ray light. :)

The code has been refactored a little further to avoid forward declarations, improve functional modularity, and allow conditional compilation. I'm including my MLL_DEV.h but of course you can suppress all my specific code from your compilations by commenting out one single PP directive #define MLL_DEV on line 5 at the top of globals.h.

My next step will be to add:
  • Viewport tooltip which, when enabled, will popup over the model's individual meshes in the OpenGL viewport to inform the user about the name as well as vertex and polygon counts of the mesh that's currently under the cursor. That's handy for the examination of very complex models when you're getting lost in the abundance of small features each of its meshes may contain.
  • Model splitting along X,Y,Z planes in the design mode for yet easier examination of the model's insides.
  • Inertial mouse that's going to behave more naturally and smoothly than your Smooth zoom mouse.
Please inform me of any glitches you may spot as well as of your general impression of the new features I added.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #164 on: November 12, 2018, 06:20:13 pm »
Ok, Mike

You can REM OUT all references to SetProcessorAffinity()

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