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

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Early WIP on v2.55
« Reply #15 on: October 26, 2018, 01:44:34 pm »
To fix the problem of material files using a qualified path, change this into Tools.h

Code: [Select]
//char* Path_CombineA(OUT char* zResource, IN char* path, IN char* combine) {
//    long offset = lstrlenA(path);
//    ClearMemory(zResource, MAX_PATH);
//    MoveMemory(zResource, path, offset);
//    MoveMemory(&zResource[offset], &combine[0], strlen(combine));
//    return zResource;
//}

char* Path_CombineA(OUT char* zResource, IN char* path, IN char* combine) {
    long offset = lstrlenA(path);
    ClearMemory(zResource, MAX_PATH);
    if (strstr(combine, "\\")) {
        strcpy(zResource, combine);
    } else {
        MoveMemory(zResource, path, offset);
        MoveMemory(&zResource[offset], &combine[0], strlen(combine));
    }
    return zResource;
}

Note: To detect the use of Ctrl key, you can use the built-in  ZI_IsCtrlKeyPressed() API.
« Last Edit: October 26, 2018, 01:55:06 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 #16 on: October 26, 2018, 04:11:45 pm »
Thanks for the fix and tip, Patrice!
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: Early WIP on v2.55
« Reply #17 on: October 26, 2018, 04:43:51 pm »
Mike

I have written the Ctrl key detection to show or hide the toolwindow,
but i was forced to make a couple changes into the code of
1 - ToolWindow.h
2 - Main.cpp

I am performing the CTRL key detection directly inside of the main message pump, from
DetectCtrlKey(&msg);

That solves a focus conflict that could occure at startup, causing the main caption bar to stay grayed, and a Windows redraw problem of the toolwindow when switching between visible and hidden.
« Last Edit: October 26, 2018, 05:09:14 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 #18 on: October 26, 2018, 09:48:20 pm »
Thanks for the update Patrice!

That solves a focus conflict that could occure at startup ...

Yet another reason to stay away from 3rd party black box frameworks. ;)
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: Early WIP on v2.55
« Reply #19 on: October 26, 2018, 11:59:06 pm »
The X-Ray transparency is my favorite one!  8)
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #20 on: October 27, 2018, 09:45:45 am »
Yes, it helps to easily inspect the model's innards. :)

I'm planning on adding yet another shader (and render mode), the model slicer, to the menu Design section. It allows the model to be split interactively into visible/invisible quadrants along the X,Y,Z movable planes that pass through the model parallel to its axes, while rendering the model in its textured state. I think it's going to be even more handy for further inner inspection under more natural conditions. 8)

Regarding diffuse reflection (that's a classic Minnaert per vertex lighting shader, an alternative to OpenGL's built in lambertian lighting model), I've chosen to include it because it renders the model in shades of black, which sometimes gives more spectacular results than model inspection in its original or default material colors. The light spot size will be adjustable via the shader controller tool window. :)
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: Early WIP on v2.55
« Reply #21 on: October 27, 2018, 10:00:35 am »
I find some of them useless (goosh, cartoon), but generally speaking anything that could help to better inspect the model is a great addition.

Note: With the latest VS2017 Community version i am able to run OR in debug mode, but i keep using VS2010 for code production because of  much smaller binary size...
« Last Edit: October 27, 2018, 11:14:13 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 #22 on: October 27, 2018, 11:43:49 am »
I find some of them useless (goosh, cartoon), but generally speaking anything that could help to better inspect the model is a great addition.

Pretty much like your own model-wide "ambient reflection". :P ;)

No, I think the ability to get some aesthetic satisfaction from models with missing/unavailable MAT files is in fact great. There are other lightweight shaders like "polka dot" or "hatch" or "stripes" and similar -- those are really of low aesthetic value and that's why I didn't include them in the list. BTW this gooch is a deviation from classic; it misses black outlines of model overall shape. I'm going to replace this shader when I find some free to use classic one.

Quote
With the latest VS2017 Community version i am able to run OR in debug mode, but i keep using VS2010 for code production because of  much smaller binary size...

I'm not sure but probably yet smaller binary could be generated if the cplusplus-ish vectors are substituted with classic arrays, and the code is fixed in compliance with standard ANSI C that would incur just one dependency -- msvcrt.dll. :)
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 #23 on: October 28, 2018, 12:06:10 pm »
Patrice,

I managed to get Z rotation up and running. It wasn't that easy due to numerous keyboard focus issues and as well as bloated viewport coords calc in ProcessMouseInput().

I fixed most focus issues but I decided to use the Design menu to launch the Z rotation mode, rather than the Alt or Z keyboard "hotkey" approach, for consistency with OR's current practices.

Do you want me to send you my fixes right away or can you wait till I finish off shader control via the new tool window?
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: Early WIP on v2.55
« Reply #24 on: October 28, 2018, 05:07:56 pm »
I can wait until you finish off shader control via the new tool window.
« Last Edit: October 28, 2018, 05:51:06 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 #25 on: October 28, 2018, 07:02:41 pm »
OK :)
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 #26 on: October 28, 2018, 08:48:46 pm »
BTW spot the two differences:  :D

8)
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: Early WIP on v2.55
« Reply #27 on: October 29, 2018, 09:11:41 am »
Brighter lighting, and more contrast because of higher straylight.

And… of course "Obj size" and "Load in", taking benefit of the extra height size added to the window and its right panel  :)

BTW: The "load in" time, seems to be almost the same than on my computer.
What woul be nice would be to update the display in real time while loading the model, to get this final report 02:02,82 (like for a StopWatch, see MBox64).

Code: [Select]
void SetStatusTime(const MFTIME &time, IN long nID, IN long redraw) {
    static MFTIME wastime = -1;
    if (wastime != time) {
        HRESULT hr = S_OK;
        WCHAR szTimeStamp[32];

        long T = (long) (time / ONE_SECOND);
        long HH = T / 3600;
        long MM = (T - HH * 3600) / 60;
        long SS = T - HH * 3600 - MM * 60;

        hr = StringCchPrintf(szTimeStamp, strSize(szTimeStamp), L"%02d:%02d:%02d", HH, MM, SS);

        if (SUCCEEDED(hr)) {
            ZD_SetObjectTextEx(nID, szTimeStamp, redraw);
        }
    }
    wastime = time;
}
« Last Edit: October 29, 2018, 09:46:19 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:: AHTUNG!!!
« Reply #28 on: October 29, 2018, 08:15:00 pm »
Patrice my friend,

I have a simple and nice model I'm often using for experimentation. It has the following MAT file:

newmtl 08___Default
illum 4
Ka 1 1 1
Kd .6 .6 .6
Ks 1 1 1
Ke 0 0 0
Ns 500
map_Ka ./Textures\Raw/Cerberus_AO.tga
map_Kd .\Textures\Cerberus_A.tga
map_Ks ./Textures/Cerberus_R.tga
map_bump .\Textures/Raw\Cerberus_N.tga


Below are the snapshots of this model rendered in an OR recompilation with Intel C++ I made two weeks ago to test its new free license I'm supposed to renew every three months, and the same model rendered in our latest "reference" OR. :'(

... GDIplus requires a fully qualified path.

Why should I care? :o

i) Wavefront OBJ format, ii) ObjReader, and iii) myself all require fully qualified, 8.3, absolute and relative paths and slashes both ways in an arbitrary order. When dealing with pathnames, first REPLACE$ their possible '/' forward slashes with '\\' back slashes and then reparse them as usual.

Quote
See this API ...

Is this supposed to mean that it is I who is supposed to fix this glitch? I have every reason to believe the regression appeared as a result of you recent material name case insensitivity "hotfix".

Can you work on it a little more, please? ::)
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: Early WIP on v2.55
« Reply #29 on: October 29, 2018, 08:57:24 pm »
send me the obj model altogether with the faulty mtl file, and i shall fix it.
Patrice
(Always working with the latest Windows version available...)