Need C++ help to finish fix for cartographic view

Post here if you want to help developing something for FAF.

Need C++ help to finish fix for cartographic view

Postby nine2 » 03 Jan 2015, 07:45

edit: here are some strings to look for to find the right part of code.

the shader filename is called "cartographic.fx".

The existing parameters are "viewMatrix", "projMatrix", "gridSizeCoeff", "terrainSizeCoeff", "elevMaximum", "elevMinimum", "frameWidth", "frameHeight", "elevTexture", "hypsometricTexture", "topographicTexture", "frameTexture", "decalTexture"

there are techniques called "Terrain_Stage0", "Terrain_Stage1", "Decal", "DecalGlow".

Basically I would be creating a new parameter that Terrain_Stage0 would use. The value for the parameter needs to be passed in from the new c++ code.

---------

edit for clarity: i am looking for someone to hack the fa executable to pass a single extra bit of data into the cartographic HLSL shader. This will allow me to override the standard cartographic view with super much more awesome 'strategic preview' instead.

---------
original post:

Dear C++ coders,

I worked out a way to get the cartographic view working for all maps. Whilst Duck has already made a tool to fix maps that don't have the cartographic data, my fix changes the cartographic HLSL shader to render something even if the data doesn't exist.

And suddenly I have the ability to implement the strategic preview in the game. Which means I will draw the terrain my way, where lines are used to represent cliffs (not contours, which is misleading). I believe this will be totally amazerific.

But I can't draw water because the shader doesn't know about water.

The C++ code passes all of the data to the shader. At the moment it does not pass the water elevation level to the shader, so it's impossible for to draw it. This is terrible. Does anyone have the ablilty to modify the c++ code to pass in this one extra parameter? That would be an impossible task for me, but it should be easy for the right guy. It's just one float field.

(If you are wondering how the current shader draws water, its because the c++ passes in a map of colors-to-elevation to render. The shader doesn't know its water, it just knows to use color X for position Y. That doesn't work for us because all colours are black on broken maps - which is why I started doing this in the first place).

FA's cartographic view:
Image

My cartographic view:
Image

My strategic view:
Image

So basically the idea is to use my cartographic view whenever the proper one is not available. I'd like to enhance the lines so that they look more like the strategic view image, because i think its much smarter. I need help to get the water in there because without water my cartographic view sucks:

My carographic view of finns revenge, with no water
Image

Help?
Last edited by nine2 on 18 Jan 2015, 07:18, edited 3 times in total.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Need C++ help to finish fix for cartographic view

Postby BushMaster » 05 Jan 2015, 07:40

im a bit confused. is it the syntax of c++ you need help with or how you would add another value to the HLSL shader and pass in that value from the c++ code? it would also be nice to know specifically which files you are looking at (specifically for the c++ code you are talking about (i thought it was LUA that was only exposed to us?)).
User avatar
BushMaster
Avatar-of-War
 
Posts: 88
Joined: 28 Jun 2014, 07:35
Has liked: 3 times
Been liked: 12 times
FAF User Name: MooseFabricator

Re: Need C++ help to finish fix for cartographic view

Postby nine2 » 05 Jan 2015, 09:18

you are right - we don't have the source code for the part i am talking about - i need someone who can hack the .exe

not sure if i need a c++ guy or an assembler guy or what

i know it's ambitious but they have done it for other features
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Need C++ help to finish fix for cartographic view

Postby nine2 » 05 Jan 2015, 09:21

added an extra line at the top of the opening post to be more clear
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Need C++ help to finish fix for cartographic view

Postby Aurion » 07 Jan 2015, 13:29

This would be golden.
Aurion
Priest
 
Posts: 380
Joined: 25 Jul 2013, 20:03
Has liked: 12 times
Been liked: 15 times
FAF User Name: NuclearPudding

Re: Need C++ help to finish fix for cartographic view

Postby rootbeer23 » 11 Jan 2015, 08:09

how about you generate a lua file with the numbers you need and then import it
rootbeer23
Supreme Commander
 
Posts: 1001
Joined: 18 May 2012, 15:38
Has liked: 0 time
Been liked: 31 times
FAF User Name: root2342

Re: Need C++ help to finish fix for cartographic view

Postby nine2 » 11 Jan 2015, 10:00

cant import lua from hlsl
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Need C++ help to finish fix for cartographic view

Postby ABSTRACT » 16 Jan 2015, 21:54

If i would have more time, i would try to decompile something, but that is a gigantic work
User avatar
ABSTRACT
Avatar-of-War
 
Posts: 110
Joined: 03 Nov 2014, 13:39
Location: Germany
Has liked: 11 times
Been liked: 5 times
FAF User Name: ABSTRACT

Re: Need C++ help to finish fix for cartographic view

Postby nine2 » 17 Jan 2015, 04:50

thanks for letting me know you have no intention of helping me :)
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Need C++ help to finish fix for cartographic view

Postby Aurion » 17 Jan 2015, 13:34

partytime wrote:thanks for letting me know you have no intention of helping me :)


Being bitchy about something generally doesn't help much as he's saying he wants to but can't. You should be nice against those people, because maybe he'll eventually get time to do it.
Aurion
Priest
 
Posts: 380
Joined: 25 Jul 2013, 20:03
Has liked: 12 times
Been liked: 15 times
FAF User Name: NuclearPudding

Next

Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest