Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: delt on November 28, 2014, 01:48:35 am

Title: Small patch: lighting on briefing screen models
Post by: delt on November 28, 2014, 01:48:35 am
Hello everyone!

I just made a small diff patch that adds lighting to the models in the "popup" window that appears when you click a ship icon in the briefings. This had always kind of (just a little bit) bugged me that they were flat and boring, unlike pretty much everywhere else in the game =)

This is the result of adding like 7 or 8 lines + a conditional compile (#ifdef) that gives the option to leave the code unchanged. Hope to see this in the next version :D :D :D


[attachment kidnapped by pirates]
Title: Re: Small patch: lighting on briefing screen models
Post by: Whitelight on November 28, 2014, 01:19:02 pm
Wow.. Nice if we could see this in an AVX build.  :D
Title: Re: Small patch: lighting on briefing screen models
Post by: AdmiralRalwood on November 28, 2014, 01:47:32 pm
Wow.. Nice if we could see this in an AVX build.  :D
There isn't really a significant performance difference between the different automatic compiler optimizations, you know.
Title: Re: Small patch: lighting on briefing screen models
Post by: chief1983 on November 28, 2014, 11:17:53 pm
From what I've heard, you'd be surprised at the jump between some of them in various situations.
Title: Re: Small patch: lighting on briefing screen models
Post by: AdmiralRalwood on November 29, 2014, 04:02:43 am
From what I've heard, you'd be surprised at the jump between some of them in various situations.
From what I've personally experienced, the maximum "jump" between SSE2/AVX is maybe 1-2 FPS, if you're lucky (and that's after correcting the project files to actually use AVX optimizations). That being said, I obviously use AVX builds myself, because even if you're only getting half a frame per second, it's still a performance gain for no actual effort.
Title: Re: Small patch: lighting on briefing screen models
Post by: TwoCables on December 10, 2014, 12:37:39 pm
Hello everyone!

I just made a small diff patch that adds lighting to the models in the "popup" window that appears when you click a ship icon in the briefings. This had always kind of (just a little bit) bugged me that they were flat and boring, unlike pretty much everywhere else in the game =)

This is the result of adding like 7 or 8 lines + a conditional compile (#ifdef) that gives the option to leave the code unchanged. Hope to see this in the next version :D :D :D

Is it possible to use this right now? If so, then how is it done?
Title: Re: Small patch: lighting on briefing screen models
Post by: delt on December 10, 2014, 01:28:36 pm
Is it possible to use this right now? If so, then how is it done?

What OS are you using? Do you have the tools to compile from source? (if you're using a unix system such as linux or freebsd, then you probably do)

I'm sure there's a GUI friendly way to accomplish the same, but i use command-line for 90% of what i do. So, assuming you have the source tarball fs2_open_3_7_2_RC4_src.tgz and the patch briefcloseup-lighting.patch in your home's Downloads directory, from a terminal window just untar the source,

Code: [Select]
cd /tmp && tar xvf ~/Downloads/fs2_open_3_7_2_RC4_src.tgz
apply the patch,

Code: [Select]
patch -p0 < ~/Downloads/briefcloseup-lighting.patch
this should tell you:

Code: [Select]
patching file fs2_open_3_7_2_RC4/code/missionui/missionbrief.cpp
...and finally recompile & install the fs2_open binary =)

Code: [Select]
cd fs2_open_3_7_2_RC4 && ./autogen.sh && ./configure && make && sudo make install
Then to play, in your launcher browse to the fs2_open_3_7_2_RC4 executable (by default it should be in /usr/local/bin) and then click "Run" or "Play" or however your launcher calls it :D
Title: Re: Small patch: lighting on briefing screen models
Post by: chief1983 on December 10, 2014, 02:01:58 pm
If you're on Windows, you can use Visual Studio Community Edition (http://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) to compile the code, and TortoiseSVN (http://tortoisesvn.net/) to acquire the code, or you can use that src.tgz file linked in the previous post.  TortoiseSVN is also useful for applying the patch on Windows via a GUI though.
Title: Re: Small patch: lighting on briefing screen models
Post by: delt on December 10, 2014, 02:16:57 pm
Just thought about it, if you're on a Mac (osx) then you probably need to install the xcode stuff to compile programs, but i haven't tested this on a mac. In fact, my experience in developing/compiling on osx is pretty null.

Compiling on windows is possible, as noted by chief1983, but it's a royal pain in the ass in my personal experience.
Title: Re: Small patch: lighting on briefing screen models
Post by: TwoCables on December 10, 2014, 03:14:12 pm
If you're on Windows, you can use Visual Studio Community Edition (http://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) to compile the code, and TortoiseSVN (http://tortoisesvn.net/) to acquire the code, or you can use that src.tgz file linked in the previous post.  TortoiseSVN is also useful for applying the patch on Windows via a GUI though.

Is this something that anyone can do, even if they have never done anything like this before? I mean, this seems to be way over my head.
Title: Re: Small patch: lighting on briefing screen models
Post by: chief1983 on December 10, 2014, 03:44:22 pm
It looks simple enough that we could probably convert it to a command line option placed under experimental and even get it shipped with 3.7.2, so if you'd want to wait for someone to make that  happen, you won't need to worry about it.  But we do have some getting started guides that can halfway decently walk you through compiling the code yourself if you can't wait, and the #scp IRC chat room would be very helpful at generally any time of day if you wanted some direction in that regard.  Getting your own build running can be kind of rewarding in my experience, tackling the build process after they moved to SVN was what got me into the SCP in the first place :)
Title: Re: Small patch: lighting on briefing screen models
Post by: TwoCables on December 10, 2014, 04:27:49 pm
It looks simple enough that we could probably convert it to a command line option placed under experimental and even get it shipped with 3.7.2, so if you'd want to wait for someone to make that  happen, you won't need to worry about it.  But we do have some getting started guides that can halfway decently walk you through compiling the code yourself if you can't wait, and the #scp IRC chat room would be very helpful at generally any time of day if you wanted some direction in that regard.  Getting your own build running can be kind of rewarding in my experience, tackling the build process after they moved to SVN was what got me into the SCP in the first place :)

Oh. Nah, I'll just wait and see if it gets shipped with 3.7.2.

I'm only here because I couldn't stand not playing FS2 anymore, so I finally searched for "FreeSpace 2 in Windows 7 x64" (which is among the best computer-related decisions I've ever made). So, I'm strictly a user.
Title: Re: Small patch: lighting on briefing screen models
Post by: Goober5000 on December 10, 2014, 07:02:53 pm
It looks simple enough that we could probably convert it to a command line option placed under experimental and even get it shipped with 3.7.2, so if you'd want to wait for someone to make that  happen, you won't need to worry about it.  But we do have some getting started guides that can halfway decently walk you through compiling the code yourself if you can't wait, and the #scp IRC chat room would be very helpful at generally any time of day if you wanted some direction in that regard.  Getting your own build running can be kind of rewarding in my experience, tackling the build process after they moved to SVN was what got me into the SCP in the first place :)

I would even tie that same command-line to the lighting in tech rooms.  I wouldn't be surprised if someone just decided to change the lighting there and didn't think to copy it to the briefing popup.

Could someone post a screenshot comparison between a briefing popup with delt's patch applied and one without?
Title: Re: Small patch: lighting on briefing screen models
Post by: delt on December 10, 2014, 07:23:23 pm

Without:



(http://www.deimos.ca/miscjunk/fs2open-screenshots/without.png)



With:


(http://www.deimos.ca/miscjunk/fs2open-screenshots/with.png)




/* edit */ Looking at these screenshots again, just a still image doesn't do it much justice.... the difference is a LOT more obvious when you see it moving.
Title: Re: Small patch: lighting on briefing screen models
Post by: chief1983 on December 12, 2014, 03:29:52 pm
I would even tie that same command-line to the lighting in tech rooms.  I wouldn't be surprised if someone just decided to change the lighting there and didn't think to copy it to the briefing popup.

What tech room lighting command line option?  I seemed to recall there having been one of those as well, but can't find it now.
Title: Re: Small patch: lighting on briefing screen models
Post by: Goober5000 on December 13, 2014, 06:21:56 pm
There isn't one.  I meant that if someone adds a command-line option to control briefing lighting, he may as well tie it to tech room lighting too.
Title: Re: Small patch: lighting on briefing screen models
Post by: chief1983 on December 14, 2014, 11:11:19 pm
Ah, but I was only suggesting this as something temporary to prevent it from having any adverse effects that we might not catch.  By the next release I'd be fine with it being the default behavior as long as it doesn't seem to cause any crashes.  That's why I suggested placing it under experimental, where it would hopefully soon move.  I'm not trying to add a new flag permanently here, we try to avoid that these days.
Title: Re: Small patch: lighting on briefing screen models
Post by: Italianmoose on January 10, 2015, 05:58:17 pm
There are briefing screen models?! =-O

And yes, I agree that looks better :)
Title: Re: Small patch: lighting on briefing screen models
Post by: chief1983 on January 14, 2015, 01:01:03 pm
Delt, any reason why the added Glowpoint_use_depth_buffer = false; line is outside of the #ifdef...#endif block?
Title: Re: Small patch: lighting on briefing screen models
Post by: delt on January 14, 2015, 01:47:44 pm
Oops... yeah, that's a mistake. Sorry about that!
Title: Re: Small patch: lighting on briefing screen models
Post by: chief1983 on January 14, 2015, 02:24:33 pm
Ok, here's my suggested patch that seems to work on my end.  Feel free to suggest any other tweaks to it (commenting adjustments, etc) and I'll see that it gets committed.

[attachment kidnapped by pirates]
Title: Re: Small patch: lighting on briefing screen models
Post by: chief1983 on January 14, 2015, 02:27:28 pm
Well, here's one formatted for SVN.  Applies much more nicely than the git one with standard patch.

[attachment kidnapped by pirates]
Title: Re: Small patch: lighting on briefing screen models
Post by: delt on January 14, 2015, 02:29:58 pm
Ok thanks, i'll test it later today.
Title: Re: Small patch: lighting on briefing screen models
Post by: chief1983 on January 14, 2015, 03:58:59 pm
FWIW, it should just be your code wrapped in a command line flag, that is found under 'Experimental', instead of wrapped in an #ifdef check.
Title: Re: Small patch: lighting on briefing screen models
Post by: delt on January 14, 2015, 09:24:32 pm
Yeah agreed. Sorry i've been busy with other stuff today, but i'll implement that as soon as i get the chance, and see if i can add the corresponding option in wxlauncher. (can't do anything about windows launchers tho)
Title: Re: Small patch: lighting on briefing screen models
Post by: AdmiralRalwood on January 14, 2015, 11:53:14 pm
Yeah agreed. Sorry i've been busy with other stuff today, but i'll implement that as soon as i get the chance, and see if i can add the corresponding option in wxlauncher. (can't do anything about windows launchers tho)
The launchers get the list of flags from FSO; adding the option to the launcher is the point of this line:
Code: [Select]
{ "-brief_lighting", "Enable lighting on briefing models", true, 0, EASY_DEFAULT, "Experimental", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-brief_lighting", },
Title: Re: Small patch: lighting on briefing screen models
Post by: chief1983 on January 15, 2015, 07:37:41 am
Yeah I mean, I think my patch is ready to commit as is, just making sure there wasn't anything else you wanted to adjust on it.
Title: Re: Small patch: lighting on briefing screen models
Post by: delt on January 15, 2015, 11:46:44 am
I think it's fine this way, thanks chief1983!