Author Topic: .sdr file question and Lighting Issues again  (Read 11486 times)

0 Members and 1 Guest are viewing this topic.

.sdr file question and Lighting Issues again
Well this is kind of a continuation of http://www.hard-light.net/forums/index.php/topic,60430.0.html but I think I sort of solved my own problem and I wanted to know why or how. I figured out that some file in mv_core was causing the problem and narrowed it down to the files in the effects folder. So I went through one by one and added each file and checked if the lighting was fixed or not. So I finally got to two files, lbgsnh-f.sdr and lbn-f.sdr which when added make the lighting the type where full textures suddenly get way brighter and then suddenly stop being bright when a gun is fired near them. Without those files, most textures show the proper lighting, where the lighting on the texture reflects the position and color of whatever is near it. However I did notice that some textures show the other weird form of lighting. What are sdr files? What do those two mentioned above, and all the others in the mv_core file do? Thanks

Edit: Also, when I place only lbgsnh-f and lbn-f in the effects folder, fs2 crashed after loading the mission. All these trials are being done using derelict scp.
« Last Edit: February 17, 2009, 11:55:00 pm by falcon2105 »
An open mind is like a fortress with its gates unbarred and unguarded.

 

Offline taylor

  • Super SCP/Linux Guru
  • 212
    • http://www.icculus.org/~taylor
Re: .sdr file question and Lighting Issues again
.sdr files are the GLSL shaders.  You can figure out what each one provides with this little key:

  • l - lighting enabled
  • b - uses base/diffuse map
  • g - glow map
  • s - specular map
  • n - normal map
  • h - height map
  • e - environment map

The -v files are vertex shaders, the -f files are fragment shaders.

I see from that other thread that you have an ATI card, which are currently known to have to lighting related issues with the shaders.  One thing to try, if you are willing to be a test subject, is to try a new set of shaders that have a couple of lighting changes.  Be sure to delete any .sdr files that you extracted and put in you data/effects folder, then download and extract http://icculus.org/~taylor/fso/misc/ma_shader.rar into the folder where you have your MediaVPs.  See if that helps any, but just know it's possible that the new shader set might be even worse.

 
Re: .sdr file question and Lighting Issues again
Ah cool, I'll give your new shaders a shot sometime soon. Lighting from beams and lasers falls under spec map right? So theoretically if i only add all the sdr files from mv_core that dont have an s in the name should my problem be somewhat solved? And what exactly do these new shaders do different from whatever was in the last mv release? Thanks again for the help.
An open mind is like a fortress with its gates unbarred and unguarded.

 

Offline taylor

  • Super SCP/Linux Guru
  • 212
    • http://www.icculus.org/~taylor
Re: .sdr file question and Lighting Issues again
Lighting from beams and lasers falls under spec map right? So theoretically if i only add all the sdr files from mv_core that dont have an s in the name should my problem be somewhat solved?
No, lighting would be any shader with a "l" in the name.  The "s" ones let you take advantage of specular maps, which is definitely something that you want, and though it can make a difference in how lighting looks it merely changes aspects of it and shouldn't be related to your problem.

Quote
And what exactly do these new shaders do different from whatever was in the last mv release? Thanks again for the help.
They use an old technique I once had for doing the lights that should be more compatible and slightly faster.  This was all tested early on in the development of the shader support and that method really didn't work out too well at the time.  The lighting function in the shaders was significantly improved over time however, but I never went back to that old method to see if it worked any better.  This new set simply changes how multiple lights are handled using that old method with the newer lighting function.

 
Re: .sdr file question and Lighting Issues again
OK so I tried your other shaders, the ones you linked me to. Sadly they dont work and everything has the funky lighting effects. After I replaced w/e I had in the effects folder before I tried your shaders, i noticed that some ships have the proper lighting (I'm just looking at damage effects in the f3 lab thing), such as the fenris and the herc. However others do not, such as the artemis and the orion. I would just not include all the sdr files with an l in the name, but thats almost all of them, and I know that some of those files dont mess up the lighting. The non-borked lighting looks so amazing haha, i can't give up. Any more ideas? Or is my only choice to just continue going through each file and testing? And do any of the files interact with each other? For example, would having only file A not do something, only file B do something, but then having both Files A and B do something completely different? Thanks
An open mind is like a fortress with its gates unbarred and unguarded.

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: .sdr file question and Lighting Issues again
I am working this issue out right now. I _think_ it is probably a case of mixed constants.

In other news, I am checking out the code to hopefully offer assistance in the direct application of OpenGL. And any further removal of DirectX if there is anything left at this point.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline Echelon9

  • 210
Re: .sdr file question and Lighting Issues again
I'm definitely interested seeing how you go with this Zacam

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: .sdr file question and Lighting Issues again
falcon2105: from the related thread, you have everything on (with the exception of height which is un-needed).

This means only the following should be applicable:

lne-v.sdr, lbgsne-f.sdr.
(lbgsnhe-f, lbsne-f and lbsnhe-f are also linked to lne-v.sdr)

So, how the two above mentioned files are causing any issues is beyond me.

But no worries. I should, after additional testing, have something for you to try.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: .sdr file question and Lighting Issues again
Double post FTW.

http://www.mediafire.com/?5n7bnd5y9jt

These are some new shaders in a VP file. If requested, I can offer a non-vp, but what would be the point?

So far, there is only 1 issue that I am aware of with the shaders: The Nameplates. However, unlike previous where any angle BUT straight on created the issue, now it only shows up from the bottom left and bottom right looking up at the nameplate. It has to do with the lighting passes, but I have tried numerous changes to the -f and -v files and the best I can do (without breaking ****) is mitigate the issue.

Oh, and taylor: While previous iterations of the mediavp shaders have probably been disappointing to you in terms of how they worked or were modified, I'd love any feedback you may have on these ones.
« Last Edit: February 23, 2009, 12:28:51 am by Zacam »
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline taylor

  • Super SCP/Linux Guru
  • 212
    • http://www.icculus.org/~taylor
Re: .sdr file question and Lighting Issues again
I can't get it to download for some reason (site error) so I'll try and grab them a bit later.

I think that the only shader revisions that I have disappointed with were my own. ;)  What I released was always intended to just be a reference set, something that people/mods should modify to their own liking.  The shaders I did were set up in a way that they should work with the least number of problems in all mods, but they aren't necessarily best suited for one data set in particular.  I'm definitely interested to see what other people come up with as far as changes though.  But as I've said before, every single line in the shaders I released was chosen for a specific reason.  That reason was either to solve a problem, to work more efficiently on a wider range of hardware/drivers, and/or to address concerns by the content makes and testers.

The ones in the MediaVPs contain two main changes from what I released, but those aren't changes that I hadn't tried myself.  The first change in the MVP versions is to deal with the conditional return, however the comparison creates a known performance hit with NVIDIA drivers.  The ma_shader VP that I made fixes this to use an older style if() set up that, due to changes in the lighting function since I last tried this method, actually works now.  That method is what was originally recommended in order to handle multiple lights in GLSL without resorting to a conditional return.  The second change in the MVP versions is to the offset for the height maps.  The original shaders I made during testing used the same value, but after playing around with it testers/artists preferred 0.02 instead so that is what was eventually settled on.

As far as the nameplate issue goes, I've mentioned before that it was always known.  I just never could figure out a good way to address the problem without major code changes.  Simply modifying the shaders never proved to be a good way to do it.  Every single change that I made to fix the nameplates just ended up breaking something else (with SoL being the best place to test for those breaks).  I just gave up and figured that the only way to actually fix the problem was with a material system.

 

Offline taylor

  • Super SCP/Linux Guru
  • 212
    • http://www.icculus.org/~taylor
Re: .sdr file question and Lighting Issues again
Ok, the download finally worked.  But going over the changes I don't really see any actual "changes".  What I do see is: 1) some map stuff is moved around a little bit, which shouldn't do anything, 2) changed to normalize halfVec twice in the fragment shaders, 3) added a max() check to dotV, but it's already clamped to [0..1] so it will never be < 0 anyway.  So, maybe I just missed it, but what is supposed to be in there besides a higher instruction count? ;)

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: .sdr file question and Lighting Issues again
By your compare, maybe not much. But compared to what was in the MediaVP's, a lot.

Instances of .rgb at the end being gone as a supposed fix: undone.

There are also a lot of consistency fixes in several files even in ma_shaders. In two or three cases, specLight= between some files was completely different.

vec3 halfV = normalize(halfVec) was pulled because in many files, halfV was only used once when it could have been used twice, though in some cases it was used three times instead of normalize(lightVec) being used to float diffuseLight (and I don't mean the float dotV). Speaking of which, vec3 lightVecNormalized = normalize(lightVec); was done away with due to A: Inconsistent usage and B: it really is not any shorter. lVecN would have been good, short and fast, but frankly, after setting the two above to long form, I did not notice either a rendering or FPS change that merited one over the other, So in the case where each is only used once, why make more text? Over all, it saves file space doing them this way.

The re-order took place because, while I can post no argument against whether it _should_ have any effect, the results says that it _does_ have an effect. At one point the bump sections got placed above ENV to make them work right.  Given that many of them were using c_env = textureCube(sEnvmap, envReflect+(c_bump * lightVecNormalized)).rgb; and the lightVecNormalized was placed after the bump, it had no chance working where it was. c_env = textureCube(sEnvmap, envReflect).rgb; is the right way of doing it, but the move was already made, so I just laid it out logically: Normal Map is the detailing to the physical lines over which the base (diffuse) map is painted over. It sounds strange, but it seems to be the perceptive case that it does do something.

While many of what is detailed above was largely already present in the ma_shaders, they were not in the mediavp shaders, so try comparing those two some time. Even compared to what was supposed to be the final version for the patch shows a lot of changes.

And for all else, it was a training exercise in load the -v, fiddle with related -f's, don't break anything, and then make sure every thing works. So far it does. If you don't notice any difference in their use given what I know I have changed, then they are doing their job.

Now to see what falcon2105 says.
« Last Edit: February 23, 2009, 05:42:22 am by Zacam »
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: .sdr file question and Lighting Issues again
Yeah I'm hoping to see the results on a range of hardware now.  I'll have to give it a shot myself, maybe with forced AA too :)
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 
Re: .sdr file question and Lighting Issues again
Sorry it took so long, I thought people had forgotten bout this thread and stopped checking for a while :D. I just tried those other shaders zacam posted but sadly they dont solve my problem. I don't know if it matters or can help you at all, but after more screwing around with the shaders from the core vp i isolated lbse-f, lbgse-f, lbgs-f, and lbgsne-f as files that when added with all the other shaders mess up my lighting. However if i put only them in the effects folder with none of the other shader files everything is fine. However i think i missed one file since lighting on the hecate and aeolus is still funky. If you want me to test anything else just let me know and ill be happy to help.
An open mind is like a fortress with its gates unbarred and unguarded.

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: .sdr file question and Lighting Issues again
That is just bizarre. I'm a little stumped, but I'll look at it more this weekend.

It suggests to me that if those files themselves work just fine unless other files are present, that the issue may not be with those files specifically, but other files in relationship to them. Otherwise, it shouldn't work on those files if they were the broken ones.

Here is a test. Extract all the shaders from the VP I posted. Dump them in to the data/effects folder. Then remove all of the LFB*-f.sdr and LF*-v.sdr files. (Note the F). Tell me if you are still having a problem with the remaining shader files.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 
Re: .sdr file question and Lighting Issues again
Well I tried your shaders after removing all LFB*-f.sdr and LF*-v.sdr files. Still had borked lighting. Then I put those back and removed the files that I mentioned in my previous post. Lighting was fixed for everything except the hecate and aeolus. And I started transcend since i started this thread (i don't know if that matters in its own right) but all of the extra ships that come with the mod had messed up lighting. Thanks for your help, but if this problem isn't gonna solve anything for anyone else you can stop trying  :lol: since I'm sure you have other more important stuff to do, I wouldn't really care.
An open mind is like a fortress with its gates unbarred and unguarded.

 

Offline ARSPR

  • Preys On Mantis
  • 29
Re: .sdr file question and Lighting Issues again
.sdr files are the GLSL shaders.  You can figure out what each one provides with this little key:

  • l - lighting enabled
  • b - uses base/diffuse map
  • g - glow map
  • s - specular map
  • n - normal map
  • h - height map
  • e - environment map

The -v files are vertex shaders, the -f files are fragment shaders.

Offtopic question:

Is this info in Wiki? I think it can be useful.

If it weren't, where should it go? (I don't mind adding it myself).
IF YOU HAVE TROUBLES WITH FS2:
  • Please, please, please, READ and UNDERSTAND the sticky threads in FreeSpace & FreeSpace Open Support board.
    A lot of people are willing to help you, but, as anyone can understand, seeing the very same "issues" repeated again and again can become quite depressing. Please, spend a bit of time trying to solve the issue by yourself.
    (Lobo deserves a monument).
  • Then, if you aren't still able to solve your issue, feel free to ask for help in that same board.
    FYI, most of the troubles are caused by wrong mod installations which lead to either missing data or undesired cross-effects between them. Always follow the mod installation instructions and keep a clean FS2 installation as explained in the sticky threads. Two additional links about how the game handles game data:
  • If you think that you've discovered a bug, mantis it.
    Provide as much info as you can, and try to narrow it down. A lonely "FS2 doesn't work" is not a good report.

Whoever Hanlon was: Never attribute to malice that which can be adequately explained by stupidity.
Albert Einstein: Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe.

Dell Dimension 9200 - Vista 32-bit Ultimate
Core 2 Quad Q6600 @2.4GHz - RAM 2 GB DDR2
nvidia 8800 GTX - Integrated Sigmatel Audio

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: .sdr file question and Lighting Issues again
Thanks for your help, but if this problem isn't gonna solve anything for anyone else you can stop trying  :lol: since I'm sure you have other more important stuff to do, I wouldn't really care.

I probably do have other more important stuff to do. And the state of the existing shaders on the whole is release ready. However, I still don't like that it is not working for somebody, and that I care about, so I am still going to work on it. And it may be possible that you are not the only one having this problem, but with the general difficulty of getting the shaders to work on the older ATi cards may mean that other people are not posting that they are. So, I am going to branch the shader development on my end until I can find a solution that works.

So, I'll see what my noggin comes up with. Thank you for trying in any case.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline ARSPR

  • Preys On Mantis
  • 29
Re: .sdr file question and Lighting Issues again
.sdr files are the GLSL shaders.  You can figure out what each one provides with this little key:

  • l - lighting enabled
  • b - uses base/diffuse map
  • g - glow map
  • s - specular map
  • n - normal map
  • h - height map
  • e - environment map

The -v files are vertex shaders, the -f files are fragment shaders.

Offtopic question:

Is this info in Wiki? I think it can be useful.

If it weren't, where should it go? (I don't mind adding it myself).

 :nervous: :nervous: No answers??  :nervous: :nervous:

This is an ultimatum. If I don't get an answer before 24h, I'm gonna post it wherever I like, in Spanish (or better in Latin), with a lot of typos, written from right to left and using Greek or Cyrillic alphabet (or even better, a mixture of them).

HA, HA, HA, HA, ... (you ALL are doomed).

Signed: the Wiki avengerTM.
IF YOU HAVE TROUBLES WITH FS2:
  • Please, please, please, READ and UNDERSTAND the sticky threads in FreeSpace & FreeSpace Open Support board.
    A lot of people are willing to help you, but, as anyone can understand, seeing the very same "issues" repeated again and again can become quite depressing. Please, spend a bit of time trying to solve the issue by yourself.
    (Lobo deserves a monument).
  • Then, if you aren't still able to solve your issue, feel free to ask for help in that same board.
    FYI, most of the troubles are caused by wrong mod installations which lead to either missing data or undesired cross-effects between them. Always follow the mod installation instructions and keep a clean FS2 installation as explained in the sticky threads. Two additional links about how the game handles game data:
  • If you think that you've discovered a bug, mantis it.
    Provide as much info as you can, and try to narrow it down. A lonely "FS2 doesn't work" is not a good report.

Whoever Hanlon was: Never attribute to malice that which can be adequately explained by stupidity.
Albert Einstein: Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe.

Dell Dimension 9200 - Vista 32-bit Ultimate
Core 2 Quad Q6600 @2.4GHz - RAM 2 GB DDR2
nvidia 8800 GTX - Integrated Sigmatel Audio

  

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: .sdr file question and Lighting Issues again
You could create a new page called GLSL Support or something and link to it from the Development Reference page.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays