Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter Visualization Project
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter Visualization Project Orbiter external graphics development.

Reply
 
Thread Tools
Old 04-13-2019, 09:28 AM   #4951
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fred18 View Post
 yep, I coded the same with just 1000 instead of 0 to see the effect of a custom height on the whole world... But I can't get it to compile due to project setup yet...
Well, I can tell you that it works just fine, so you are on the right path .
Face is offline   Reply With Quote
Thanked by:
Old 04-13-2019, 12:03 PM   #4952
fred18
Addon Developer

Default

when trying to compile I keep getting the error:
MSB4019 The imported project "C:\Orbiter2016\Orbitersdk\VS2015\PropertyPages\or biter_plugin.props" was not found. Verify that the path in the declaration <Import> is correct and that the file is on the disk.

I tried many things in project properties, but this breaks compilation immediately and I can't do anything else.
fred18 is offline   Reply With Quote
Old 04-13-2019, 01:00 PM   #4953
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fred18 View Post
 when trying to compile I keep getting the error:
MSB4019 The imported project "C:\Orbiter2016\Orbitersdk\VS2015\PropertyPages\or biter_plugin.props" was not found. Verify that the path in the declaration <Import> is correct and that the file is on the disk.

I tried many things in project properties, but this breaks compilation immediately and I can't do anything else.
Try extracting this into your /orbitersdk/resources/ folder: resources.zip
Face is offline   Reply With Quote
Old 04-13-2019, 02:50 PM   #4954
fred18
Addon Developer

Default

Quote:
Originally Posted by Face View Post
 Try extracting this into your /orbitersdk/resources/ folder: Attachment 16578
Nope, I add to do the following just to get close:
- open the D3D9ClientVS2017.vcxproj with notepad
- change all the references to vs2015\..whatever it was\orbiter_plugin.props to the proper orbitersdk\resources\orbiter plugin.props and the debug.props
- add a copy of the given orbiter plugin.props and orbiter debug.props with the underscors (orbiter_plug.props and orbiter_debug.props)
- add manually to the project properties the inclusion directory of orbitersdk/include and the lib orbitersdk\lib

still I get that
Code:
class "oapi::GraphicsClient" does not include any member "LABELTYPE"
class "oapi::D3D9Client" does not include any member "GetSurfaceMarkerLeged"
and all the relevant errors because those objects are not recognized
fred18 is offline   Reply With Quote
Old 04-13-2019, 02:58 PM   #4955
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fred18 View Post
 still I get that
Code:
class "oapi::GraphicsClient" does not include any member "LABELTYPE"
class "oapi::D3D9Client" does not include any member "GetSurfaceMarkerLeged"
Could it be that the version you've checked out from the repo is the one for the beta Orbiter engine, but you try to compile in an stock 2016 environment?

Surface labels ring a bell there.
Face is offline   Reply With Quote
Old 04-13-2019, 03:47 PM   #4956
fred18
Addon Developer

Default

Quote:
Originally Posted by Face View Post
 Could it be that the version you've checked out from the repo is the one for the beta Orbiter engine, but you try to compile in an stock 2016 environment?

Surface labels ring a bell there.
I just opened svn://mirror.orbiter-radio.co.uk/D3D9client/trunk as Jarmo said to do

---------- Post added at 16:47 ---------- Previous post was at 16:18 ----------

I just managed to compile it with your link in bitbucket.. Finally!!! thank you Face!!!
fred18 is offline   Reply With Quote
Old 04-13-2019, 07:36 PM   #4957
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fred18 View Post
 I just managed to compile it with your link in bitbucket.. Finally!!! thank you Face!!!
You're welcome. That links just points to the right branch for stock 2016 development. You should be able to do the same with SVN, but there you need to know how to handle SVN branches properly.

---------- Post added at 21:36 ---------- Previous post was at 19:02 ----------

I played with it a bit, and the following code can put a flattened circle on the tiles on the fly:
Code:
float lat = +34.58; // Vandenberg coordinates
float lng = -120.62;
float radius = 300 * 0.00001; //Approx. decimal degrees for 1 meter at equator
INT16 height = 2;

float bands = pow((float)2, lvl);
float width = 180 / bands;
float step = width / 256;
float latmin = 90 - width*(ilat + 1) - step * 1.5;
float latmax = 90 - width*ilat + step * 1.5;
float lngmin = -180 + width*ilng - step * 1.5;;
float lngmax = -180 + width*(ilng + 1) + step * 1.5;
float radius2 = radius * radius;
if (elev && latmin < lat + radius && latmax > lat - radius && lngmin < lng + radius && lngmax > lng - radius) for(auto i=0;i<ndat;i++)
{
	float y = latmin + (i / 259)*step - lat;
	float x = lngmin + (i % 259)*step - lng;
	if (x*x+y*y<radius2) elev[i] = height;
}
This puts a hole in the ground at the Vandenberg location. Of course it is not smoothing the edges or tuning the performance, but the demonstration seems nice.
Face is offline   Reply With Quote
Thanked by:
Old 04-13-2019, 10:44 PM   #4958
fred18
Addon Developer

Default

EDIT : moved to a new thread to highlight the result and not contaminate the D3D9 thread

Last edited by fred18; 04-14-2019 at 08:56 AM.
fred18 is offline   Reply With Quote
Thanked by:
Old 04-14-2019, 01:01 AM   #4959
Felix24
Orbinaut
Default

Quote:
The tiger-stripes is a common problem in a self-shadowing. It's usually more intense when sun angle is low. Also the shadow-map resolution setting in D3D9Client.cfg may effect to the results. I'll try to make some adjustments to reduce the stripes.
Has a solution to the "tiger stripes" been found yet? I think I found one (at least I hope it helps in the search): In PBR.fx, in two places:

Around line 198-ish:
PHP Code:
cSun *= ComputeShadow(frg.shdHdLNsc); 
And around line 455-ish:
PHP Code:
float fShadow ComputeShadow(frg.shdHdLNsc); 
The lines above should be changed to:
PHP Code:
cSun *= smoothstep(00.72ComputeShadow(frg.shdHdLNsc)); 
and
PHP Code:
float fShadow smoothstep(00.72ComputeShadow(frg.shdHdLNsc)); 
I noticed that there used to be lines like these in PBR.fx a while back, but it was removed for some reason. The modification causes the shadows to no longer creep around into the sunlit areas of objects, but it also makes the shadows be sharper. What other issues might this cause, Jarmo? I hope it doesn't break other things.

Here are a couple of screenshots showing the stripes on the stock ISS:

Before:

9 samples


27 samples dithered


After:

9 samples


27 samples dithered


Attached is the scenario I am using for the screenshots.
Attached Files
File Type: scn (Current state) 0002.scn (1.5 KB, 2 views)
Felix24 is offline   Reply With Quote
Thanked by:
Old 04-14-2019, 09:16 AM   #4960
jarmonik
Beta Tester

Default

Quote:
Originally Posted by Felix24 View Post
 Has a solution to the "tiger stripes" been found yet? I think I found one (at least I hope it helps in the search): In PBR.fx, in two places:

I noticed that there used to be lines like these in PBR.fx a while back, but it was removed for some reason. The modification causes the shadows to no longer creep around into the sunlit areas of objects, but it also makes the shadows be sharper. What other issues might this cause, Jarmo? I hope it doesn't break other things.

Thanks about the fixes. It looks good here, I am not aware of any other implications except the sharper shadows which isn't a problem really. I have committed the changes to SVN.
jarmonik is offline   Reply With Quote
Thanked by:
Old 04-15-2019, 09:24 PM   #4961
kuddel
Donator
Default D3D9 Client Build Instructions

@fred18: I tried to update our README.txt. Could you please take a look if everything you've experienced is covered somehow?
Any other suggestions / corrections etc. are welcomed, too

Code:
ORBITER VISUALISATION PROJECT -
D3D9 Client Build Instructions

This Document describes the steps needed to build D3D9Client from the sources.
This document uses Visual Studio 2015 (Community Edition) as the main compiler,
but it should be very similar with Visual Studio 2017. As new versions will
appear (Visual Studio 2019) and time goes by there might be some difference in
the procedures.
In case your current Visual Studio versions needs some changed procedures,
please notify the developers at the orbiter-forums "D3D9Client Development"
thread (https://www.orbiter-forum.com/showthread.php?t=18431).


1. Required components
----------------------

To be able to compile D3D9 graphics client from the sources, you need:

* The fitting Orbiter libraries and headers.
  As a minimal build environment you only need the files from
  - Orbitersdk/include
  - Orbitersdk/lib
  - Orbitersdk/resources (Orbiter 2016)
    rsp.
    Orbitersdk/VS2015    (Orbiter BETA)

  The easiest way to get these directories is to run the get_orbiter_libs.bat
  script from Utils/D3D9Client.

  Another option is just to install the complete Orbiter installation, which
  will also have the benefits of being able to instantly debug the client.

* A Windows C++ compiler (Visual Studio 2015 Community Edition is ok, later
  versions should be fine, clang should also work, other compilers may or may
  not work).

* For a DirectX graphic client, you obviously also need the respective 3-D
  graphics SDKs. The D3D9 client builds with the MS DirectX June 2010
  SDK.
  You need the DirectX Software Development Kit (Version 9.29.1962 or newer) to
  build the client. It can be downloaded at Microsoft Download Center at
    https://www.microsoft.com/en-us/down...s.aspx?id=6812

  If you have an existing Microsoft Visual C++ 2010 Redistributable installed
  on your computer, you may receive an "S1023" error when you install the June
  2010 DirectX SDK.
  To resolve this issue follow the instructions from
    https://support.microsoft.com/en-us/...-sdk-june-2010

  To run the client later on you also need the DirectX End-User Runtimes (June
  2010 or newer). These can be downloaded at Microsoft Download Center at
    https://www.microsoft.com/en-us/down...s.aspx?id=8109
  (See http://users.kymp.net/~p501474a/D3D9...ctX%20Runtimes for
  details on that).

* OPTIONAL (nVIDIA)
  NVIDIA API (needed since stereoscopic option was introduced in the Client)
  The NVAPI can be downloaded from the nVIDIA developer site at
    https://developer.nvidia.com/nvapi

  If you don't like to install the NVIDIA API (it's not needed if stereoscopic
  option should not be available in the client), you do not need to do
  anything.
  During the build process (pre compiling) a dummy header "nvapi.h" will be
  generated into the main source directory (Orbitersdk/D3D9Client)
  automatically if it does not yet exist.
  This also means that if you *have* installed the NVIDIA API and copied the
  header file into the main source directory (Orbitersdk/D3D9Client) it will
  *not* be touched or overwritten by any further build process.

* OPTIONAL (Documentation)
  To recompile the D3D9 source documentation you need Doxygen from
    http://www.stack.nl/~dimitri/doxygen/

  There is a doxygen configuration file in D3D9Client/doc/Doxyfile which
  can be used to generate the compressed html help file
  Orbitersdk/D3D9Client/doc/D3D9Client.chm included in the repository.
  Additionally to doxygen itself some other packets might be needed (depending
  on the output format you would like to generate) to create the 'chm' file
  you need:
  - Microsoft HTML Help Workshop (compiler for .CHM files)
      http://go.microsoft.com/fwlink/?LinkId=14188
  - Graphviz (for the 'dot' tool to generate graphs)
      http://www.graphviz.org/

* OPTIONAL (7-Zip)
  In order to create release-packages (ZIPs) a convenient build_release.bat
  script is used. If you like to be able to run that script without any errors
  you also need 7-Zip to be installed:
    https://www.7-zip.org/

  The build_release.bat script expects the executable to be at
  "C:\Program Files\7-Zip\7z.exe", so to minimize any issues with that you
  should keep that (default) location.


2. Building the D3D9 client
---------------------------

To compile the sources of the D3D9 graphics client, you have two options:

* Via IDE
  Just start the solution file that fits your compiler version.
  - Orbitersdk\D3D9Client\D3D9ClientVS2010.sln (Visual Studio 2010)
  - Orbitersdk\D3D9Client\D3D9ClientVS2012.sln (Visual Studio 2012)
  - Orbitersdk\D3D9Client\D3D9ClientVS2015.sln (Visual Studio 2015)
  - Orbitersdk\D3D9Client\D3D9ClientVS2017.sln (Visual Studio 2017)

  In case you have a more recent version of Visual Studio (like Visual Studio
  2019 for example), you should take the solution file with the highest number.
  Visual Studio will usually be able to migrate the project- and solution-files
  to the current version (The names however will not match your Visual Studio
  version, though).

* Via build_release.bat
  Just run build_release.bat from the folder Utils/D3D9Client and the client
  should be build without any further action required.
  The script likes to creates two ZIP release-packages at the end of a
  (successful) build, so to make that part work you need 7-Zip as well (see
  Required components).


3. Testing the D3D9 client
--------------------------

* If the compilation of the D3D9 client was successful, it has created a
  plugin in Modules/Plugin/D3D9Client.dll.

* Run the "no-graphics" version of orbiter (orbiter_ng) and activate
  the D3D9Client plugin from the Modules tab.

* You should now get a video tab in the Launchpad dialog. Configure your
  graphics driver and screen options, then launch a scenario.

* The Visual Studio project files should all be able to just run the Debug-
  Button. This however always starts with the "(Current state)" Scenario, so
  you might need to start at least once via orbiter_ng.exe to setup a fitting
  scenario to work with when debugging.
kuddel is offline   Reply With Quote
Thanked by:
Old 04-15-2019, 10:10 PM   #4962
fred18
Addon Developer

Default

Quote:
Originally Posted by kuddel View Post
 @fred18: I tried to update our README.txt. Could you please take a look if everything you've experienced is covered somehow?
Any other suggestions / corrections etc. are welcomed, too
Hi Kuddel, thanks. I will go again through this to see if the step by step is fine.

I also didn't know about some batches in the utils folder.

Anyway I gave a look at the get_orbiter_libs.bat file and it says
Code:
svn export --force -r %REV% %URL%/VS2015/PropertyPages %OUT_DIR%/VS2015/PropertyPages || goto exit_nok
I don't know batches very well but it seems to me that the structure "VS2015/PropertyPages" is preserved even using this.

That was a huge headache I had. I had to edit manually the vcxproj to delete the references to VS2015/propertypages and set them to orbiter/resources folder. Also the properties were named "orbiter_plugin.props" and "orbiter_debug.props" but in the resources folder they currently are orbiter plugin.props and orbiter debug. props (with the space, not the underscore), so I had to create a copy of the props with the underscore.

I will go again through the process, as said but this was the major issue


Fred
fred18 is offline   Reply With Quote
Old 04-15-2019, 11:26 PM   #4963
kuddel
Donator
Default

Quote:
Originally Posted by fred18 View Post
 Anyway I gave a look at the get_orbiter_libs.bat file and it says
Code:
svn export --force -r %REV% %URL%/VS2015/PropertyPages %OUT_DIR%/VS2015/PropertyPages || goto exit_nok
I don't know batches very well but it seems to me that the structure "VS2015/PropertyPages" is preserved even using this.
It's more a "feature" of the svn export here, but as you mention it I might have to add svn to the "Required components", too.
Although having the sources I guess one might have svn...
Nevertheless TortoisSVN used to have a check box like
[ ] install command line programs o something like that, which is essential for the batch scripts to work!
So thanks for looking into this Future developers will benefit!
kuddel is offline   Reply With Quote
Old 04-17-2019, 11:42 AM   #4964
kuddel
Donator
Default

@fred18: Since you've used Visual Studio 2019 (if I remember correctly), could you be so kind and send me (or post) the Solution-, Project- and Filter-Files that have been updated?
I assume you've used the "2017" Solution which got migrated by Visual Studio 2019 then.
I want to add those project files to the repository and as I am not 100% sure what exactly Visual Studio 2019 will have changed in those files a reference would be nice.

A ZIP containing
- Orbitersdk/D3D9Client/*.filters
- Orbitersdk/D3D9Client/*.sln
- Orbitersdk/D3D9Client/*.vcxproj
would be a "save selection"

The attached ZIP contains "my guesses" on what the files should look like...

Regards,
Kuddel
Attached Files
File Type: zip VS2019_prj(guessed).zip (5.1 KB, 2 views)

Last edited by kuddel; 04-17-2019 at 03:38 PM.
kuddel is offline   Reply With Quote
Old 04-18-2019, 08:52 PM   #4965
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So I am trying to get D3d9 back working.
So I downloaded this:
https://www.tuttovola.org/index.php?...view;down=1104

and Now I get DirectX runtimes maybe missing.
So I installed this:https://www.microsoft.com/en-us/down...n.aspx?id=9033

Unzipped into a blank folder and ran setup.
But still get that error:
log:
Code:
00000.000: ---------------------------------------------------------------
000000.000: Module D3D9Client.dll ........ [Build 190406, API 160828]
000000.000: 
000000.000: **** Creating simulation session
000000.000: D3D9: [DirectX 9 Initialized]
            D3D9: 3D-Adapter.............. : AMD Radeon HD 8330
            D3D9: MaxTextureWidth......... : 16384
            D3D9: MaxTextureHeight........ : 16384
            D3D9: MaxTextureRepeat........ : 8192
            D3D9: VolTexAddressCaps....... : 0x3F
            D3D9: NumSimultaneousRTs...... : 4
            D3D9: VertexDeclCaps.......... : 0x3FF
            D3D9: MiscCaps................ : 0x3FCCF2
            D3D9: XNA Math Support........ : Yes
            D3D9: Vertex Texture.......... : Yes
            D3D9: Shadow Mapping.......... : Yes
            D3D9: D3DFMT_A16B16G16R16F.... : Yes
            D3D9: D3DFMT_A32B32G32R32F.... : Yes
            D3D9: D3DFMT_D32F_LOCKABLE.... : Yes
            D3D9: D3DFMT_A2R10G10B10...... : Yes
            D3D9: D3DFMT_L8............... : Yes
            D3D9: D3DDTCAPS_DEC3N......... : Yes
            D3D9: D3DDTCAPS_FLOAT16_2..... : Yes
            D3D9: D3DDTCAPS_FLOAT16_4..... : Yes
            D3D9: Runs under WINE......... : No
            D3D9: Available Texture Memory : 4095 MB
000000.000: D3D9: [3DDevice Initialized]
D3D9: ERROR: D3D9Surface.cpp Line:2045 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, 0, 0, 0, 0, &FX, &errors)
D3D9: ERROR: Failed to create an Effect (Modules/D3D9Client/CKBlit.fx)
D3D9: ERROR: D3D9Pad.cpp Line:87 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, 0, 0, 0, 0, &FX, &errors)
D3D9: ERROR: Failed to create an Effect (Modules/D3D9Client/Sketchpad.fx)
D3D9: ERROR: D3D9Effect.cpp Line:341 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, macro, 0, D3DXSHADER_NO_PRESHADER|D3DXSHADER_PREFER_FLOW_CONTROL, 0, &FX, &errors)
D3D9: ERROR: Failed to create an Effect (Modules/D3D9Client/D3D9Client.fx)
D3D9: ERROR: PlanetRenderer.cpp Line:193 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, macro, 0, 0, 0, &pShader, &errors)
D3D9: ERROR: Failed to create an Effect (Modules\D3D9Client\Surface.fx)
D3D9: ERROR: Scene.cpp Line:2997 Error:-2147024770 D3DXCreateEffectFromFile(pDev, name, 0, 0, 0, 0, &FX, &errors)
D3D9: ERROR: Failed to create an Effect (Modules/D3D9Client/SceneTech.fx)
gattispilot is online now   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter Visualization Project

Tags
d3d9client, graphicsclient


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 07:56 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.