Project D3D11Client Development

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,403
Reaction score
581
Points
153
Location
Vienna
well I did everything as you've described, but the build is failing saying stuff like that:

I've checked - that's what's actually in .vcxproj file, but those files don't exist in repo. First files are probably from SDK, so this part is fixable, but what about files like CSphereMgr.cpp? There are quite a number of such files - it looks like project file was not updated for a while...

Indeed it is so. If you check Glider's ZIPs, you'll see that he just packages the code, no project files. Therefore, Glider's master is just a dump of his ZIP archive, plus some infrastructure files.

The Face/Glider branch is me fixing solutions and projects for it, but as you can see in the history, I didn't update it for his newest snapshot.

I've never used Hg before (I'm MS guy - so TFS, and sometimes SVN :tiphat:) so if you would assist me I'd really appreciate it :)

Well, in this case you have to go through a paradigm shift. HG is a DVCS, and as such it works completely different to centralized VCSs like TFS or SVN. With the later, you have only one central repository on some server, with commit permissions for several users. With DVCS, there is no central repository, but copies of the repo on every developer's machine.
Thus you can "clone" the repo to your machine and commit locally without having to ask for permission. Later on you can "push" your new commits to some other repository you have permission to (let's say your own bitbucket repo - it's free there), or you can ask someone to "pull" from you (via the built-in webserver), or you simply send patches or bundles via conventional channels (email, forum).

Unfortunately it is a bit too much to describe it here, but I can give some links: TortoiseHg for the de-facto standard Windows GUI (batteries included) and Joel Spolsky's tutorial.

Oh, by the way: MS uses Mercurial, too ;) .

regards,
Face

---------- Post added at 08:10 ---------- Previous post was at 08:01 ----------

Oh, I see you already forked/cloned it on Bitbucket. So now you can use TortoiseHg to clone it to your machine, commit your changes locally in whatever granularity you like, then push it to your Bitbucket fork. From there, I can pull it into my repository. But as my repository is in no way a blessed one, it wouldn't matter. That's the essence of being distributed.

---------- Post added at 08:14 ---------- Previous post was at 08:10 ----------

...and of course you've done that already :) . Well, I guess you've got it, then ;) .

---------- Post added at 08:53 ---------- Previous post was at 08:14 ----------

Pulled asmi's changes as Asmi/master branch to my repo and merged it into my Face/Glider branch (with added re-compiled binary). Looks good! Nice work, asmi.
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
I'm a quick learner :) As any real developer has to be :)
As I said I've set up project file and made some changes to set up debug build and debugging mode. Now as you build project, make sure you set up desired build config - debug config for development, and release - for release. As you can see from code, there are few differences now in those configs :)
 

Glider

Addon Developer
Addon Developer
Joined
Apr 12, 2008
Messages
226
Reaction score
0
Points
16
Location
Saint-Petersburg
BTW - what do you guys use for editing shaders? I use this plugin for Visual Studio, which offers nice syntax highlighting.
I use the same thing for HLSL. Also I use "Highlighterr" (http://highlighterr.codeplex.com/) for additional highlighting of macros/#defines and class/struct/function names in C++ code.

Currently I'm working on extended TileManager class (TerrainManager), with support of heightmaps, normal maps and LCC maps for planets and other features. TileManager code was significantly modified (I removed L8-L14 vertex buffers and created only 1 VB with 2 kinds of tile meshes. And then I use vertex sahder to create needed resolution level using heightmap texture and ilat, nlat, ilng, nlng, lvl. It should remove L14 limitation and allow simplier code. Also it will be needed for other features I want to add. ), so first I will try to get this new class working. If it will work correctly, I will merge my code with asmi's, fork Face's repo and upload my changes there.
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
I use the same thing for HLSL. Also I use "Highlighterr" (http://highlighterr.codeplex.com/) for additional highlighting of macros/#defines and class/struct/function names in C++ code.

Currently I'm working on extended TileManager class (TerrainManager), with support of heightmaps, normal maps and LCC maps for planets and other features. TileManager code was significantly modified (I removed L8-L14 vertex buffers and created only 1 VB with 2 kinds of tile meshes. And then I use vertex sahder to create needed resolution level using heightmap texture and ilat, nlat, ilng, nlng, lvl. It should remove L14 limitation and allow simplier code. Also it will be needed for other features I want to add. ), so first I will try to get this new class working. If it will work correctly, I will merge my code with asmi's, fork Face's repo and upload my changes there.

I had similar plans, however instead of bump-mapping I was going to use tesselation as "real" geometry looks way better then whatever you can simulate with bump/normal mapping. But this requires us to stick to shader model 5, and, therefore, feature level 11 (FL11) only - as hardware tesselation doesn't work in SM4 (or, more accurately have severe restrictions as the only way to that is to use geometry shaders, while with the use of Hull and Domain shaders we can achieve amazing detail with very little performance drawback). I'm using Alienware M17R3 laptop with 3D monitor so my hardware is SM5-compliant :)
I think what we really need to do is to settle down a list of things we're going to implement, otherwise it will very quickly become just a mixture of "feats" completely unrelated to each other, which will serve the purpose of a hobby projects, yet will not be anything useful for anyone other than author.
And to give this discussion a kickstart, here is what I suggest:
1. Property implement beacons for vessels, including proper lighting by them - I've already implemented that in my project, so I will take care of transferring it to this project - consider it done for now :)
2. Adaptive tesselation for planet rendering - currently specular highlights looks very bad at close distance due to large size of trianges. And/or properly implemented Phong per-pixel lighting for terrain.
3. After (1) is done, we'll need to come up with some way of implementing per-pixel lighting for vessel, that would also support variable lights count. There is a prioblem that you can't pass an array between pipeline stages, so I'd suggest to remedy this problem again with adaptive3 tesselation - if primitives are small enough you can't tell the difference between per-vertex and per-pixel lighting.
4. After (3) is done, we'll need to come up with some way to provide a self-shadowing parts of the vessel - like a central body of the vessel occluding a wing for the beacon that's on another wing. Shadow maps sounds unpractical due to multiple passes neccessary to create map (one pass - one light source), so I'd suggest applying Parralax Occlusion Mapping or similar approach to fix it up.
5. Add some post-processing effects like lense glare and such - it will improve realism.
6. Design some sort of API for vessel developers so they would be able to take advantage of great array of new possibilities that were brought by D3D11. Possibly custom shaders, advanced particle effects.
7. I'd move computing particle systems' state propagation into compute shaders to free up CPU for the simulation itself. Again FL11 only.

That is what I've got in mind - please comment/add your thoughts on the subject.

Oh, and one more thing - please please please give variables some more meaningful names than "aux" - especially in shaders. And comments! :)
 
Last edited:

Glider

Addon Developer
Addon Developer
Joined
Apr 12, 2008
Messages
226
Reaction score
0
Points
16
Location
Saint-Petersburg
I had similar plans, however instead of bump-mapping I was going to use tesselation as "real" geometry looks way better then whatever you can simulate with bump/normal mapping. But this requires us to stick to shader model 5, and, therefore, feature level 11 (FL11) only - as hardware tesselation doesn't work in SM4 (or, more accurately have severe restrictions as the only way to that is to use geometry shaders, while with the use of Hull and Domain shaders we can achieve amazing detail with very little performance drawback). I'm using Alienware M17R3 laptop with 3D monitor so my hardware is SM5-compliant :)
Actually, I intended to use normal mapping only for high-orbit views and then switch to real geometry based on heightmaps. I understand that normal mapping doesn't look good on spherical planets at low altitudes. Also, there's one big problem:
Large % of users doesn't have DX11 hardware.

1. Property implement beacons for vessels, including proper lighting by them - I've already implemented that in my project, so I will take care of transferring it to this project - consider it done for now :)
yes, that should be nice.

2. Adaptive tesselation for planet rendering - currently specular highlights looks very bad at close distance due to large size of trianges. And/or properly implemented Phong per-pixel lighting for terrain.
I think much more important thing is to turn current large planet balls into something that have terrain. So, I suggest add support of heightmaps, + add heightmap generator for planets without heightmap files. Large ball with PPL and tesselation doesn't differ much from a large ball with PVL.

3. After (1) is done, we'll need to come up with some way of implementing per-pixel lighting for vessel, that would also support variable lights count. There is a prioblem that you can't pass an array between pipeline stages, so I'd suggest to remedy this problem again with adaptive3 tesselation - if primitives are small enough you can't tell the difference between per-vertex and per-pixel lighting.
FL11...

4. After (3) is done, we'll need to come up with some way to provide a self-shadowing parts of the vessel - like a central body of the vessel occluding a wing for the beacon that's on another wing. Shadow maps sounds unpractical due to multiple passes neccessary to create map (one pass - one light source), so I'd suggest applying Parralax Occlusion Mapping or similar approach to fix it up.
Yes, shadows from local lights would be nice feature.

5. Add some post-processing effects like lense glare and such - it will improve realism.
Also, good feature.

6. Design some sort of API for vessel developers so they would be able to take advantage of great array of new possibilities that were brought by D3D11. Possibly custom shaders, advanced particle effects.
I don't think addon devs will use that... May be when this client will have some really impressive features they will, but not at first.

7. I'd move computing particle systems' state propagation into compute shaders to free up CPU for the simulation itself. Again FL11 only.
It shouldn't create much difference... but it doesn't seems to be very hard to add. And why only FL11 ? CS works on FL10/10_1 with some restrictions though...

That is what I've got in mind - please comment/add your thoughts on the subject.
Features I suggest to implement first:
1.Since you have already implemented beacons as point-lights it would be nice to add them first.
2.real terrain on planets + heightmap generation + vessel/tile collisions
3.shadow mapping for vessels + shadows for beacons/local lights
4.Better clouds
5.lens glare
6.better atmosphere
7.vegetation (and other details on terrain)
8.may be some hdr lighting ?

Then, I think we should start work on features that require FL11.
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
First I'm going to comment on your replies
1. For terrain we can use heightmaps to generate geometry right on the GPU - in Domain shader you have total control over all vertex properties and you can position them whatever way you see fit. This technique will also greatly decrease memory requirements for storing all this geometry, as all details will be generated inside the pipeline. As a fallback solution for SM4 I'd suggest geometry generation using GS - allthough its' abilities are limited compated to full-blown HS/Tesselator/DS, it's still better than nothing. The benefit of this approach is still the same - we can use current "flat" surface as input and generate everything on the fly. So don't worry about balls :) And heightmap generation is a very good idea - allthough it might have to be pre-calculated, manually verified and shipped with the plugin to rule out possible artefacts like having Everest mountain in the middle of KSC's runaway :)
2. Again as a fall-back technique for SM4 we can leverage GS.
3. Vessel self-shadowing - we need to think about plausable approach. It has to look good and at the same time work fast - as vessel is the thing that we stare at most of the time during flight :)
5. Post-processing effects include a wide variety of things - lense glare, HDR to name a few - and that's where Compute Shaders will become extremely handy - as almost all PP effects require (quazi-)random access to original image and are computationally heavy, but can be parallelyzed to hundreds of processing cores we've got on GPU.
6. Well the needs of API might affect some design decisions we make as we progress with our development. Also we might just take some open-source vessel and add all these cool features, and other devs amazed by the possibilities might just jump on the train :) I don't mean that we'll heave to implement it right now - all I'm saying is that we have to keep that in mind.
7. Particle systems - moving them onto CS will allow us to tremendously increase particle density (GPUs are hundred times more powerful than CPU because there are hundreds of them :)) and so greatly increase visual quality.

Now to your things:
1. As I said - consider it done :) I will add this in a matter of days.
2. For terrain - pls see my comment above about tesselation - no need to eat up memory with that stuff that can be generated on the fly. Collision detection is a physics engine feature, so there is no way we can implement it - we have to ask Martin to do so :)
3, 4 Agreed
5. See my notes above about PP effects in general
6 agreed
7. That's as easy as 1-2-3 with instancing. Could be added any second right after we figure out a plausable algorithm for positioning them.
8. That's a PP effect as well, so see above.

Also there is one more feature that is absolutely needs to be implemented and that I've forgotten to mention - we need to add rendering/animating ground base objects like runaway lights. That actually is the subject that brought me to this forum in the first place :)
 
Last edited:

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
I don't think addon devs will use that... May be when this client will have some really impressive features they will, but not at first.

Speaking as an addon developer, I have to agree with this point. Once the DX11 client is up and going at least where the DX9 client is now in terms of stability, end-user features (eye-candy), etc. then looking at an API to let developers implement vessel-specific features might be good.
 

Jarod

Member
Joined
Dec 13, 2011
Messages
169
Reaction score
0
Points
16
Do you plan to add self shadowing terrain ?

tycho-crater-moon-shadows.jpg
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Speaking as an addon developer, I have to agree with this point. Once the DX11 client is up and going at least where the DX9 client is now in terms of stability, end-user features (eye-candy), etc. then looking at an API to let developers implement vessel-specific features might be good.
Yes I absolutely understand that. As for eye-candy looks - I'd argue it already looks better than stock graphics client, and if we'll implement everything mentioned above - it will add a lot in terms of visual quality. Allthough I do realize that we've got quite a long run ahead of us before in can be declared as "stable" - I envision at least several months, since we all do that in our spare time...

Do you plan to add self shadowing terrain ?

tycho-crater-moon-shadows.jpg
That would certainly be on our TODO list after we'll implement terrain one way or another. BTW stream-out feature of GS 5 would be extremely helpful as we can do a miltiple passes without a need to re-calculate terrain for a shadow maps.
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Glider,

Take a look at the screenshot to see what tesselation is all about (click to enlarge):
tesselation.png

This was generated from a single square (4 vertices + 4 indices) using tesselation factor of just 20 (up to 64 is available), and then morphed in Domain shader to a sphere patch using parametric sphere equation. If you want - I can give a source code for that so you can play around with it - it's really very simple. In our case we can accurately morph mesh according to heightmap + possibly use some spline interpolation algorithm like smooth Bezier curves to produce very impressive results.
 

Veterok

New member
Joined
Oct 25, 2011
Messages
65
Reaction score
0
Points
0
Also, there's one big problem:
Large % of users doesn't have DX11 hardware.

I think most people who want the game to look even better already have, or are willing to buy DX11 hardware. The required hardware is getting cheaper.

No need to worry about people who are satisfied with the DX7 engine, they won't be using this engine anyways.

Glider said:
2.real terrain on planets + heightmap generation + vessel/tile collisions
:thumbup:
That's number one on my wishlist.

My number two is high detail (cm/pixel level) textures and mesh/sprite rocks and vegetation.

:cheers:
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Ok, got some good news - I've added beacons' lighting and pushed it into my fork. Face - pls merge.
Here are a couple of screenshots (click to enlarge):
Nighttime:beacons_vpl_night.png
Daytime:beacons_vpl_day.png
Of couse you've gotta see it in dynamic as when beacons are blinking so do lights :) It looks as good as it could be with per-vertex lightning. Take a closer look at wings - you'll distinctively will see trianges, which is bad :( Tomorrow evening I'm gonna try creating a GS using SM4 to provide at least some tesselation so it would look a bit better...

Also I've done it pretty quick&dirty - we'll probably need to create separate shaders for the vessels' meshes, and another one for everything else, as now there is a performance penalty, allthough not a big one. Don't look at FPS which is displayed on daytime screenshot - this is a debug version, so no optimization whatsoever neither for C++ code nor for shaders.

Enjoy! :cheers:
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
I think most people who want the game to look even better already have, or are willing to buy DX11 hardware. The required hardware is getting cheaper.

No need to worry about people who are satisfied with the DX7 engine, they won't be using this engine anyways.
I was thinking about the same thing. In addition realistically another good half a year will pass by before we would be able to get non-devs to use it and not get CTD every now and then :)
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,403
Reaction score
581
Points
153
Location
Vienna
Ok, got some good news - I've added beacons' lighting and pushed it into my fork. Face - pls merge.

Thanks, merged it in. It is now under the master branch, I guessed "Face/Glider" isn't cutting it anymore ;) .
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Thanks, merged it in. It is now under the master branch, I guessed "Face/Glider" isn't cutting it anymore ;) .

Thank you, Face. BTW - do you have anything to say in regards of what we're discussing regarding plans?
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,403
Reaction score
581
Points
153
Location
Vienna
Thank you, Face. BTW - do you have anything to say in regards of what we're discussing regarding plans?

As I'm currently not so deep in code details, I have only two minor opinions here:

1. Feature-level functions should be configurable. I.e., while I too think that D3D11 should be the "high-level" client, the possible user-base should be optimized however. Therefore, the client should be usable for low-cost card-owners, too. It could nevertheless be possible to implement switchable features for high-end cards. So I'd say min. FL10_0. That would mean 4.0 model and only 16 input slots (I vaguely remember no cubemaps, too).

2. API should come later. Better to get the default features up to D3D9 level before going ahead with advanced features.

Everything else sounds reasonable. I'd also suggest to put that into a Wiki, so we have a quick look-up table for the milestones/progress. It really doesn't matter where we do it, but I think forum-threads are not really straightforward if it comes to clarity. Also a dedicated Wiki might be overkill.
Thus I propose to put the project infos into my OVP repo's Wiki on BB. Not really full of fancy features like e.g. TRAC, but enough for our purpose here. If we agree to this, I can handle the initial page.

regards,
Face
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
1. Feature-level functions should be configurable. I.e., while I too think that D3D11 should be the "high-level" client, the possible user-base should be optimized however. Therefore, the client should be usable for low-cost card-owners, too. It could nevertheless be possible to implement switchable features for high-end cards. So I'd say min. FL10_0. That would mean 4.0 model and only 16 input slots (I vaguely remember no cubemaps, too).
I'm sorry guys, but at work I've got this videocard, which costs $30 and yet it's fully DirectX 11-compliant (tesselation screenshot that I've published yesterday was made on my work computer using that card), so I think we can close this discussion off right here - if $30 is expensive then there is something seriously wrong with my understanding of what is cheap and what isn't :)

2. API should come later. Better to get the default features up to D3D9 level before going ahead with advanced features.

Everything else sounds reasonable. I'd also suggest to put that into a Wiki, so we have a quick look-up table for the milestones/progress. It really doesn't matter where we do it, but I think forum-threads are not really straightforward if it comes to clarity. Also a dedicated Wiki might be overkill.
Thus I propose to put the project infos into my OVP repo's Wiki on BB. Not really full of fancy features like e.g. TRAC, but enough for our purpose here. If we agree to this, I can handle the initial page.

regards,
Face
Agreed, go ahead.
 

Glider

Addon Developer
Addon Developer
Joined
Apr 12, 2008
Messages
226
Reaction score
0
Points
16
Location
Saint-Petersburg
First I'm going to comment on your replies
1. For terrain we can use heightmaps to generate geometry right on the GPU - in Domain shader you have total control over all vertex properties and you can position them whatever way you see fit. This technique will also greatly decrease memory requirements for storing all this geometry, as all details will be generated inside the pipeline. As a fallback solution for SM4 I'd suggest geometry generation using GS - allthough its' abilities are limited compated to full-blown HS/Tesselator/DS, it's still better than nothing. The benefit of this approach is still the same - we can use current "flat" surface as input and generate everything on the fly. So don't worry about balls :) And heightmap generation is a very good idea - allthough it might have to be pre-calculated, manually verified and shipped with the plugin to rule out possible artefacts like having Everest mountain in the middle of KSC's runaway :)

2. For terrain - pls see my comment above about tesselation - no need to eat up memory with that stuff that can be generated on the fly.
Then may be make terrain in that way:
L1-L7 works same way they work now, but with normal maps (and PP lighting + increased vertex number for L1-L3).
L8-LMAX works this way:
there's small buffer with 1 L8 32x32 tile mesh and 1 L8 polar tile (+IB for them).

Then in the case of FL10:
VS copies everything to GS
GS will set needed vertex positions, normals and tangents for resolution level that we have to generate, compute Sun Color for each vertex + may be it can do some limited tesselation
PS will use computed in VS Sun color + PP lighting (+ normal map, if it exist for the planet and we have L8-L10).

In the case of FL11:
VS copies all to HS
HS/tesselator/DS sets correct vertex positions and tesselates originally 32x32 tile mesh if needed + compute Sun Color
GS does nothing
PS does same thing that was for FL10

So, no level higher than L7 will consume memory for mesh, + it will be possible to get L > L14.

Collision detection is a physics engine feature, so there is no way we can implement it - we have to ask Martin to do so :)
I don't think that terrain without any collisions will be useful... Besides, How Martin is supposed to do this if only the client has access to heightmap information (and, since tile meshes will be generated in GS or HS ) ? Also, there's VESSEL::AddForce() function that can be used to push vessel from terrain + VESSEL::SetTouchdownPoints and VESSEL::GetTouchdownPoints that IMO, can be used to allow landed vessel be stable on high time accelerations.

BTW, about heightmap generation: there's "libnoise" library that can generate Perlin and other types of noise. It can work fast enough to dynamically generate heightmap tiles (33x33 or 65x65), is open source and very easy to use... :) May be it is possible to create a heightmap generator (with generation in separated thread of course) with it.

2. Again as a fall-back technique for SM4 we can leverage GS.
Or just use it for FL11 only...

3. Vessel self-shadowing - we need to think about plausable approach. It has to look good and at the same time work fast - as vessel is the thing that we stare at most of the time during flight :)
I don't have good ideas about this right now. Indeed, we should think about best approach;

5. Post-processing effects include a wide variety of things - lense glare, HDR to name a few - and that's where Compute Shaders will become extremely handy - as almost all PP effects require (quazi-)random access to original image and are computationally heavy, but can be parallelyzed to hundreds of processing cores we've got on GPU.
Yes, CS is usefull for this things. I agree that CS definitely should be used for that. (at least in FL11, not sure how it will work on CS_4_0)

6. Well the needs of API might affect some design decisions we make as we progress with our development. Also we might just take some open-source vessel and add all these cool features, and other devs amazed by the possibilities might just jump on the train :) I don't mean that we'll heave to implement it right now - all I'm saying is that we have to keep that in mind.
Keep in mind - yes, but implement after the client will be stable and have enough advanced features.

7. Particle systems - moving them onto CS will allow us to tremendously increase particle density (GPUs are hundred times more powerful than CPU because there are hundreds of them :)) and so greatly increase visual quality.
Well, if we're going to increase particle density, then, yes usage of CS will be good. I meant that CS isn't required for current number of particles.:)

7. That's as easy as 1-2-3 with instancing. Could be added any second right after we figure out a plausable algorithm for positioning them.
May be vegetation/details can be done that way:
1. LCC map can be used as a source of information about vegetation type in some place of Earth. (with IGBP encoding)
2. As a simpliest model we can use forest microtexture in pixel shader (when some tile is being rendered) and find correct forest type of some pixel from LCC map in PS, then sample it from texture array and add to tile texture.
3. As a average model is possible to use a vertex buffer with random points on surface with dimensions of L15 (or other) tile and turn them into many tree billboards in GS.(tree/grass/bush type can be sampled from LCC) Then PS use Tree/Bush/Grass/Rock texture arrays and vegetation type that billboard have from GS.
4.As a most detailed model may be some simple mesh can be used with instancing (and may be use positions of points from average resolution points-tile to position these meshes). But there's a problem to find out correct tree/whatever mesh type that should be in some point...

In the case of a planet other than Earth it is possible to use 2-3 types of rocks on surface.

Also there is one more feature that is absolutely needs to be implemented and that I've forgotten to mention - we need to add rendering/animating ground base objects like runaway lights. That actually is the subject that brought me to this forum in the first place :)
May be Martin will add this in the next version of Orbiter's grphics API...

So it seems that list of features now looks like this:
2. terrain + hmap generator + collisions (see comments above)
3,4,
5. lens glare or something (with CS if needed)
6.
7. see comments about vegetation above
8. may be some hdr, terrain shadows, runway lights (and etc.) or something else...

I think that minimal supported FL of all this features must be FL10 (at least those features that can be done with FL10), but we may create improved FL11 versions of the same features too.

If you want - I can give a source code for that so you can play around with it - it's really very simple.
Yes, this would be great. I actually, don't use much these FL11-only things, so source code would be interesting.
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Then may be make terrain in that way:
L1-L7 works same way they work now, but with normal maps (and PP lighting + increased vertex number for L1-L3).
L8-LMAX works this way:
there's small buffer with 1 L8 32x32 tile mesh and 1 L8 polar tile (+IB for them).

Then in the case of FL10:
VS copies everything to GS
GS will set needed vertex positions, normals and tangents for resolution level that we have to generate, compute Sun Color for each vertex + may be it can do some limited tesselation
PS will use computed in VS Sun color + PP lighting (+ normal map, if it exist for the planet and we have L8-L10).

In the case of FL11:
VS copies all to HS
HS/tesselator/DS sets correct vertex positions and tesselates originally 32x32 tile mesh if needed + compute Sun Color
GS does nothing
PS does same thing that was for FL10

So, no level higher than L7 will consume memory for mesh, + it will be possible to get L > L14.
I think we still going to need to do some vertex displacement in VS stage - it will just be "coarse" representation of terrain, and then morph/interpolate it in a latter stages (GS/DS).

I don't think that terrain without any collisions will be useful... Besides, How Martin is supposed to do this if only the client has access to heightmap information (and, since tile meshes will be generated in GS or HS ) ? Also, there's VESSEL::AddForce() function that can be used to push vessel from terrain + VESSEL::SetTouchdownPoints and VESSEL::GetTouchdownPoints that IMO, can be used to allow landed vessel be stable on high time accelerations.
If you remember there is a support for heightmaps in current TILEDESC's - it just isn't implemented atm. This makes me think that Martin is(was) planning to implement it at some point...

BTW, about heightmap generation: there's "libnoise" library that can generate Perlin and other types of noise. It can work fast enough to dynamically generate heightmap tiles (33x33 or 65x65), is open source and very easy to use... :) May be it is possible to create a heightmap generator (with generation in separated thread of course) with it.
We can just use HLSL intrinsic "noise" to generate it right inside shader :)

Well, if we're going to increase particle density, then, yes usage of CS will be good. I meant that CS isn't required for current number of particles.:)
Correct, but the more particles is almost always better :)

May be vegetation/details can be done that way:
1. LCC map can be used as a source of information about vegetation type in some place of Earth. (with IGBP encoding)
2. As a simpliest model we can use forest microtexture in pixel shader (when some tile is being rendered) and find correct forest type of some pixel from LCC map in PS, then sample it from texture array and add to tile texture.
3. As a average model is possible to use a vertex buffer with random points on surface with dimensions of L15 (or other) tile and turn them into many tree billboards in GS.(tree/grass/bush type can be sampled from LCC) Then PS use Tree/Bush/Grass/Rock texture arrays and vegetation type that billboard have from GS.
4.As a most detailed model may be some simple mesh can be used with instancing (and may be use positions of points from average resolution points-tile to position these meshes). But there's a problem to find out correct tree/whatever mesh type that should be in some point...

In the case of a planet other than Earth it is possible to use 2-3 types of rocks on surface.
We can get hi-poly tree model from 3D Max (there is a tree/vegetation meshes generator), we can find a model online or create it ourselves - it's not that much of a problem. Also, billboard approach might be a bit problematic 'cause we are going to see it from above AND from long distances. So we need to be smart about what kind of texture to apply - likely we'll need several ones for different viewing angles...

May be Martin will add this in the next version of Orbiter's grphics API...
I actually asked this question and they're saying that it's a low priority, which as far as I understand is just a polite way of saying "It won't happen", so looks like we are on our own here. Allthough granted it isn't that big deal as there are just a handful of objects supported by the core.

So it seems that list of features now looks like this:
2. terrain + hmap generator + collisions (see comments above)
3,4,
5. lens glare or something (with CS if needed)
6.
7. see comments about vegetation above
8. may be some hdr, terrain shadows, runway lights (and etc.) or something else...

I think that minimal supported FL of all this features must be FL10 (at least those features that can be done with FL10), but we may create improved FL11 versions of the same features too.
Ok then, I think we'll leave this whole terrain thing for you as you're already working on it :) I will be working on vessel-related things - specifically will try to figure out a way to improve the way beacon lighting looks, after that I can take care of ground base-related stuff as I've already done some research on that. PP effects can be implemented completely independent of everything else, so whoever will get there first will take it :)

Yes, this would be great. I actually, don't use much these FL11-only things, so source code would be interesting.
Here it is: View attachment Engine.zip It's essentially slightly modified version of the sample from this tutorial, so all the credit goes there :)
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
I actually asked this question and they're saying that it's a low priority, which as far as I understand is just a polite way of saying "It won't happen", so looks like we are on our own here. Allthough granted it isn't that big deal as there are just a handful of objects supported by the core.
Do you mean me by "they"? I only relayed what was said 2 years ago. This doesn't mean it won't happen.
 
Top