Fractal Softworks Forum

Starsector => Mods => Modding Resources => Topic started by: Dark.Revenant on May 04, 2014, 01:33:25 AM

Title: [0.7.2a] ShaderLib Beta 1.2.1b (Legacy)
Post by: Dark.Revenant on May 04, 2014, 01:33:25 AM
NOTICE: This mod is outdated! Click HERE (http://fractalsoftworks.com/forum/index.php?topic=10982) for GraphicsLib.




(http://i.imgur.com/vPv4Tfp.gif) (https://www.mediafire.com/?aex71w33te57l2d)

Download ShaderLib Beta 1.2.1b (https://www.mediafire.com/?aex71w33te57l2d)
Download Mirror (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.2.1b.7z)

We also recommend Version Checker (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.

Warning: Make sure Starsector is GPU-Accelerated!
ShaderLib will glitch out on older integrated chips!

Having problems?  Visit the Mod Troubleshooting Guide (http://fractalsoftworks.com/forum/index.php?topic=10931)!


What is this?
ShaderLib is an ongoing effort to implement practical shaders in Starsector.  While this library does have major common features, such as the lighting engine and distortion engine, it was developed so that mod developers can write and implement their own shaders and use them within the game.


Features
  • Lighting engine for Starsector; just plug and play!
  • Lighting API to add lighting data for mod-added weapons
  • HDR bloom for bright surfaces
  • Material mapping for customized ship reflectivity
  • Normal mapping for Blinn-Phong contour lighting and specular highlighting
  • Surface mapping for specular intensity and hardness
  • Distortion engine for all kinds of unique space-warping effects
  • Suite of helper functions designed to make implementing shaders quick and easy
  • Shader API to add shaders into the render loop and allow developers to make their shaders usable by other mods
  • User-defined performance settings
  • Several example shaders for developers to get started


System Requirements
Vanilla
  • 1.8 GHz Intel Core i3/i5/i7 CPU
  • 2.3 GHz Intel Core2 CPU
  • 2.6 GHz AMD CPU
256+ MB Video Memory

Minimum
  • 2.0 GHz Intel Core i3/i5/i7 CPU
  • 2.5 GHz Intel Core2 CPU
  • 2.8 GHz AMD CPU
GeForce 6800, Radeon X850, or Intel HD Graphics 3000
384+ MB Video Memory (512 MB with mods)

Low
  • 2.0 GHz Intel Core i3/i5/i7 CPU
  • 2.5 GHz Intel Core2 CPU
  • 2.8 GHz AMD CPU
GeForce 8600, Radeon HD 2600, or Intel HD Graphics 4000
384+ MB Video Memory (512 MB with mods)

Medium
  • 2.2 GHz Intel Core i3/i5/i7 CPU
  • 2.6 GHz Intel Core2 CPU
  • 3.0 GHz AMD CPU
GeForce 8800 or Radeon HD 2900
512+ MB Video Memory (768 MB with mods)

Recommended
  • 2.2 GHz Intel Core i3/i5/i7 CPU
  • 2.6 GHz Intel Core2 CPU
  • 3.0 GHz AMD CPU
GeForce GTX 260 or Radeon HD 4870
512+ MB Video Memory (1024+ MB with mods)


Screenshots
(http://i.imgur.com/SbXGy2J.png) (http://i.imgur.com/bpgS9tA.png)

(http://i.imgur.com/TEwoZki.png) (http://i.imgur.com/jE7vhKh.png)
Spoiler
(http://i.imgur.com/rjFh3bc.png)

(http://i.imgur.com/f0XcAg4.png)

(http://i.imgur.com/a7dH9ax.png)

(http://i.imgur.com/4oFuZRa.png)

(http://i.imgur.com/AMB9iYB.png) (http://i.imgur.com/YwlXL0D.png)

(http://i.imgur.com/4ALyPAh.png)

(http://i.imgur.com/nSJ9fqf.png)
[close]


How to Use
For players: Just download and enable the mod.  You don't have to do anything else; it works right out of the box.  If your computer can't handle ShaderLib, don't download it and don't enable it.  Simple as that.

For modders: If you want to incorporate ShaderLib into your mod, you should follow a setup procedure:
Use the following mod detection code in your ModPlugin class.  If you want to make calls to ShaderLib functions or use ShaderLib objects, you must first check to see that hasShaderLib is true before calling/referencing them!  Note that some scenarios may make this arrangement difficult, requiring ShaderLib for resolving class links.
Code: java
public static boolean hasShaderLib;

@Override
public void onApplicationLoad() {
    hasShaderLib = Global.getSettings().getModManager().isModEnabled("shaderLib");

    if (hasShaderLib) {
        ShaderLib.init();
        LightData.readLightDataCSV("data/lights/your_light_data.csv");
        TextureData.readTextureDataCSV("data/lights/your_texture_data.csv");
    }
}

Material Map: This texture determines the reflectivity of the sprite.  Internally, the lighting engine uses a minimum function (i.e. reflectivity = the darker of the pixel on screen and the corresponding pixel on the material map), so there are limitations on what you can do with a material map.  In general, you want to begin with the original ship sprite and then darken areas that should not reflect as much light.  You can also darken individual color channels to allow interesting effects like having reflected shines being a different color than the hull.  Remember that the material map must have an alpha channel that matches the original sprite's alpha channel.  For implementation, see the example in ShaderLib.  If a sprite lacks a material map, the default is the original sprite (i.e. identical to previous lighting versions).

Normal Map: This texture is difficult to make properly, but the results can be well worth it.  There are many tutorials for making normal maps elsewhere on the Internet, if you are interested in making them for vanilla sprites or your own ships.  However, if you want an easy way out, an adequate normal map can be generated automatically through Photoshop, Crazy Bump, or similar programs, which takes far less time than making a normal map from the ground up.  Remember that the normal map must have an alpha channel that matches the original sprite's alpha channel.  For implementation, see the example in ShaderLib.  If a sprite lacks a normal map, the lighting engine will default to using the old lighting model for that sprite rather than the new Blinn-Phong model.

Surface Map: This texture is completely optional (even more so than the other two).  Surface maps enhance the normal map of the object by influencing how the specularity looks.  The red channel corresponds to luminosity and will cause the ship to appear to glow wherever the red channel is nonzero.  The green channel determines the specular intensity of the object; a value of zero is totally matte while a high value will be very shiny.  The blue channel determines specular hardness, so a value of zero is cartoonishly shiny while a high value is very glossy; a value of 0.2 (or 51 on the integer scale) corresponds to the default behavior.  Remember that the surface map must have an alpha channel that matches the original sprite's alpha channel.  If a sprite lacks a surface map, the lighting engine will substitute red = 0, green = (derived from material map), blue = 0.2.


Warnings
You generally need an OpenGL 3.0-capable card to use the lighting and distortion engines.  Older cards can work, but this is not guaranteed.  Performance may vary, but a GTX 260 or better should be sufficient to run without any performance hit on the default settings, and with settings tweaks virtually any compatible card will work fine.  Mobile drivers are known to have problems with ShaderLib.  Integrated graphics chipsets are NOT guaranteed to work!  If you are using an integrated chip, disable distortions and/or post-processing!



(http://i.imgur.com/wuYEFc5.png) (http://www.sc2mafia.com/Starsector/donate/index.html)


Change Log
1.0.0 (Unreleased)
- Renamed GraphicsLib
- shaderSettings.json renamed to GRAPHICS_OPTIONS.ini
- Added graphical effects plugins previously in Starsector+
- Added data/config/no_self_destruct.csv in case you want your mod-added missiles to not explode automatically

Beta 1.2.1 (February 28, 2016)
- Fixed cover-related glitches and crashes

Beta 1.2.0 (February 26, 2016)
- Updated for Starsector 0.7.2a
- Weapon cover maps supported
- Option defaults improved for users with incompatible hardware
- Benchmark mission improved

Beta 1.1.2 (December 8, 2015)
- Significantly reduced ShaderLib CPU usage
- Added "extraScreenClear" option to shaderSettings.json (set to false to reduce fill rate)

Beta 1.1.1 (November 30, 2015)
- Now ACTUALLY updated for Starsector 0.7a
- Added new asteroid types to lighting maps

Beta 1.1.0 (November 19, 2015)
- Updated texture/lighting content for Starsector 0.7a
- Updated Becnhmark metrics and scoring
- Added optimized SectorMark mission for official benchmarks

Beta 1.07 (June 6, 2015)
- Added Post Processing Shader
- Added color blindness presets
- Added "enablePostProcess" and "colorBlindnessMode" options to shaderSettings.json
- Remade Benchmark mission; added SectorMarks scoring system

Beta 1.06 (March 13, 2015)
- Improved default lighting settings
- Made graphics more compliant; should have fewer glitches, especially on cards that used to have problems

Beta 1.05 (February 16, 2015)
- Improved distortions compatibility (hopefully)
- Made ship skin textures fall back to base hull textures if an entry for the skin doesn't exist

Beta 1.04 (February 16, 2015)
- Improved bloom compatibility (hopefully)
- Adjusted lighting data
- Resolved possible memory leaks

Beta 1.03 (January 8, 2015)
- Additional optimizations
- Fixed loaded missile lighting
- Added Performance Test mission
- Added method to DistortionShader: void removeDistortion(DistortionAPI distortion)
- Added method to LightShader: void removeDistortion(DistortionAPI distortion)

Beta 1.02 (December 8, 2014)
- Code review and cleanup
- Code optimizations: up to a 20% increase in frame rate

Beta 1.01 (November 10, 2014)
- Made framebuffers more compatible, should resolve some bugs
- Added methods to ShaderLib: boolean useBufferEXT(), boolean useBufferARB(), boolean useBufferCore()

Beta 1.0 (November 3, 2014)
- Weapon barrels and loaded missiles are now affected by lighting
- Fixed bug with WaveDistortion

Beta 0.9 (October 23, 2014)
- Updated for Starsector 0.65a
- Shaders no longer draw on top of the UI
- Major stability update
- Shaders should behave more consistently
- Asteroids and missiles are now affected by lighting
- Weapon unders are now affected by lighting (barrels and loaded missiles are broken for now)
- All maps updated to reflect new ship sprites; new maps added for new ships/skins
- ShaderLib settings file renamed to "shaderSettings.json"
- Removed static texture definitions; mods should no longer define textures in settings.json
- Added smart texture loading to dramatically reduce memory usage when options are turned down
- Removed "category" and "key" columns from the texture data CSV
- Added "path" column to the texture data CSV
- Added "loadMaterial" option to shaderSettings.json
- Added "loadSurface" option to shaderSettings.json
- Added "useLargeRipple" option to shaderSettings.json
- Split "brightnessScale" to "intensityScale" and "sizeScale" options in shaderSettings.json
- Added method to DistortionAPI: float getArcAttenuationWidth()
- Several methods renamed or changed in some manner
- Removed ShaderLib.setVanillaViewport()
- Removed weapon "shadows" (the effect never worked quite right)


Alpha 1.7 (August 30, 2014)
- Surface maps added to all vanilla ships and weapons
- Issue with ShaderLib Basic fixed
- Version Checker support added
- Rare crashes fixed
- Benchmark mission added

Alpha 1.66 (July 13, 2014)
- Shaders being disabled no longer stops a ShaderAPI from being loaded (they can double as EveryFrameCombatPlugins now)
- Beam lights and fast projectile lights are more accurate on impact with objects (but not perfect until the next Starsector update)

Alpha 1.65 (July 9, 2014)
- Changed default reload key to F10
- Updated lighting shader to avoid minor graphics glitches on the edges of objects when using surface maps

Alpha 1.64 (July 9, 2014)
- Fixed major memory leak when reloading shaders
- Changed default reload key to F11
- Lighting shader now runs even if no lights are onscreen (smooths performance and makes things more consistent)

Alpha 1.63 (July 8, 2014)
- Fixed weapon blend function override bug

Alpha 1.62 (July 3, 2014)
- Added surface map support (only used if normal maps are enabled)
- Added method to StandardLight: void makePermanent()
- Added method to ShaderLib: void setWeaponShadowDirection(Vector2f direction)
- Added fixed-direction shadows to weapons when the ship is lit up with lights
- Rare "light leaks" eliminated

Alpha 1.61 (June 30, 2014)
- Added "magnitude" column to texture data CSV for normal map magnitude changes per texture
- Modified vanilla ship material maps (darkened and increased contrast, across the board)
- Slightly tweaked vanilla lights

Alpha 1.6 (June 24, 2014)
- Added "reloadKey" option to settings.json
- Added method to ShaderAPI: void destroy()
- Added methods to ShaderLib: int getAuxiliaryBufferTexture(), int getAuxiliaryBufferId()
- Memory usage improved

Alpha 1.52 (June 16, 2014)
- Added "weaponFlashHeight" and "weaponLightHeight" options to settings.json
- Fixed ShaderLib Basic again

Alpha 1.51 (June 11, 2014)
- Added missile material and normal map support, plus vanilla missile material and normal maps (these will not do anything until the next Starsector update)
- Fixed crash for ShaderLib Basic

Alpha 1.5 (June 9, 2014)
- Added texture loader tables; you will need to define your material and normal maps in a csv
- TextureEntry and TextureData added
- Fixed quality-5 bloom causing bloom to disappear
- Significant CPU performance increase with lighting and normal maps

Alpha 1.45 (May 31, 2014)
- Added material maps and normal maps for all vanilla ships and weapons
- Fixed weapon material and normal maps (you can now specify whether it is the hardpoint or turret)
- Minor viewport fixes that may improve compatability with other mods that use OpenGL
- Fixed screen scaling issue in windowed mode when the window resolution is equal to the desktop resolution
- Fixed specularity direction error on point, line, and cone lights
- Lights no longer reflect on phased ships
- Re-adjusted default settings
- Split ShaderLib into two distributions: Basic and Full

Alpha 1.4 (May 27, 2014)
- Fixed normal rotation and direction issues
- Added support for cone-type and directional-type lights
- Added "normalFlatness" option to settings.json
- Removed unnecessary setter methods from LightAPI
- Maximum lights reduced to 372
- Material-mapped hulks now have much less specularity and reflectivity
- Added methods to LightAPI: float getArcStart(), float getArcEnd(), Vector3f getDirection(), float getSpecularIntensity(), float getHeight()
- Added methods to StandardLight: void setArc(float start, float end), void setDirection(Vector3f direction), void setSpecularIntensity(float intensity), void setHeight(float height)

Alpha 1.3 (May 26, 2014)
- Blinn-Phong lighting added to Lighting Engine for cases where a sprite uses a normal map (this feature is off by default and is intended for TC mods and a possible future where more sprites have normal maps)
- Added "enableNormal", "specularIntensity", "specularHardness", and "lightDepth" options to settings.json
- Rare NVIDIA fullscreen "ghosting" issue resolved
- Light data documentation added (in the data/lights folder)
- Custom material maps supported (to use, link a texture to the ship/weapon by adding a key to "graphics" in data/config/settings.json; see example in ShaderLib)
- Custom normal maps supported (to use, link a texture to the ship/weapon by adding a key to "graphics" in data/config/settings.json; see example in ShaderLib)
- Example normal and material maps added for Conquest, Onslaught, and Paragon (the normal maps were machine-generated)

Alpha 1.24 (May 24, 2014)
- Added an alternative low-memory animated ripple
- Decreased graphics memory usage, especially when shaders are disabled
- Fixed file naming standards

Alpha 1.23 (May 23, 2014)
- Restructured internal rendering code

Alpha 1.22 (May 23, 2014)
- Fixed a major issue on some computers involving sprite alignment
- Added method to ShaderLib: void setVanillaViewport()

Alpha 1.21 (May 23, 2014)
- Update to the light and bloom shaders for clarity and slightly better performance
- Changed displayable mod name to "ZZ ShaderLib" so it loads and runs last
- Added "use64BitBuffer" option to settings.json
- Improved color depth

Alpha 1.2 (May 19, 2014)
- Bloom effect added to Lighting Engine (for situations where the lights are particularly bright)
- Added "enableBloom", "bloomQuality", "bloomMips", "bloomScale", and "bloomIntensity" options to settings.json
- Added methods to StandardLight: void setVelocity(Vector2f velocity), void setVelocity2(Vector2f velocity), Vector2f getVelocity(), Vector2f getVelocity2(), Vector2f setOffset(), Vector2f getOffset()
- Added methods to WaveDistortion and RippleDistortion: void setVelocity(Vector2f velocity), Vector2f getVelocity()
- Added methods to ShaderLib: void drawScreenQuad(float scale), void copyScreen(int texture, int textureUnit)
- Added "offset" column to lights CSV (how many pixels behind the projectile to spawn the standard light, which may be useful for missiles; ignored for beams)
- Added "fighterBrightnessScale" option to settings.json (default 0.5)
- Added two arguments (int texture, int textureUnit) to ShaderLib.screenDraw()
- Updated WaveDistortion texture (should act properly now; to get a sphere, set the intensity to 1/4 the size)
- Updated RippleDistortion texture
- Fixed enableLights and enableDistortion settings options
- Updated LightAPI's advance method to return a boolean representing whether it should be destroyed that frame or not

Alpha 1.11 (May 17, 2014)
- Added methods to DistortionAPI: float getArcStart(), float getArcEnd() (allows only a certain subset of the direction vectors to apply)

Alpha 1.1 (May 17, 2014)
- Universal Distortion Engine (DistortionShader) added
- Added "enableDistortion" and "maximumDistortion" options to settings.json
- DistortionAPI added
- Added WaveDistortion type
- Added RippleDistortion type
- Added "flash offset" column to lights CSV (how many pixels behind the projectile to spawn the muzzle flash, which should not be needed for most weapons; ignored for beams)
- Added method to LightAPI: void advance(float amount)
- Internal shaders externalized to the shaders folder (modify at your own risk)
- Some additional documentation added

Alpha 1.05 (May 11, 2014)
- Fixed most of the issues related to animated weapons causing flickering lights

Alpha 1.04 (May 8, 2014)
- Added "brightnessScale" option to settings.json (default 1.0)

Alpha 1.03 (May 6, 2014)
- Added method to LightData: void readLightDataCSVNoOverwrite(String localPath)
- Added method to ShaderLib: int getScreenTexture()
- Added "maximumLineLights" option to settings.json (default 50)
- Serious AMD performance issue resolved; will be slightly faster for nVidia users as well

Alpha 1.02 (May 5, 2014):
- Added method to ShaderLib: ShaderAPI getShaderAPI(Class<? extends ShaderAPI> shaderAPI)
- Fixed problems and possible memory leaks if mods used LightShader.addLight when the user has lights disabled/unsupported
- Documented and expanded StandardLight and LightAPI
- Toned down the vanilla lights

Alpha 1.01 (May 4, 2014):
- AMD Hotfix
Title: Re: [Graphics] ShaderLib Alpha v1.0
Post by: Debido on May 04, 2014, 01:46:06 AM
If I haven't said it before, I'll say it again, this is probably one of the single most important user created mods ever.
Title: Re: [Graphics] ShaderLib Alpha v1.01
Post by: Dark.Revenant on May 04, 2014, 03:20:49 AM
Small update to fix a major issue some AMD card users were having.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.01)
Post by: Dark.Revenant on May 04, 2014, 03:48:53 PM
Try using the attached light data instead of the original one (just replace the file in data/lights/).  See if you like it better; the lights are significantly subtler.

[attachment deleted by admin]
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.01)
Post by: kazi on May 04, 2014, 04:05:55 PM
This looks glorious.

Although the fx are a bit over the top in the screenshots you posted, it still looks so much better than vanilla its not even funny. (my video card even supports Open GL3!)

Will definitely try this out in a few hours once I get a few errands done.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.01)
Post by: xenoargh on May 04, 2014, 04:06:28 PM
Looking forward to firing this up when I get done with what I'm doing tonight; prolly will be able to give some detailed feedback by Tues. :)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: Dark.Revenant on May 04, 2014, 11:41:55 PM
Updated:
- Added method to ShaderLib: ShaderAPI getShaderAPI(Class<? extends ShaderAPI> shaderAPI)
- Fixed problems and possible memory leaks if mods used LightShader.addLight when the user has lights disabled/unsupported
- Documented and expanded StandardLight and LightAPI
- Toned down the vanilla lights
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: GenBOOM on May 05, 2014, 05:23:50 AM
just gotta say, this is totally awesome
(http://mashable.com/wp-content/uploads/2013/07/rainbow-vomit.gif)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: xenoargh on May 06, 2014, 08:06:28 AM
Took a brief look last night.

1.  It's confusing how to connect up OpenGL code with the shaders.  Definitely needs some documentation :)

2.  The lighting system is slower than is ideal.  Don't get me wrong- first-run alpha and all that, and it certainly works, which is amazing.  But a quick glance at the code reveals that it's not culling stuff outside the POV and it's not using clipping planes, both of which should speed things up by a factor of 10 or more in big scenes.  Right now, it's using 30% of all CPU time, more than Combat.Advance and Combat.Render combined.  I may take a whack at optimizing it when I'm not buried in work, it really will be incredible when it's fast enough :)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: Dark.Revenant on May 06, 2014, 12:33:36 PM
It actually is culling nearly everything outside the POV (including pixels on the fragment shader, light and foreground objects, the original screen texture copy method, etc.) and there are no places where clipping planes would do anything worthwhile (at worst, it draws a few extra pixels on some ships on the boundaries of the screen, which doesn't affect the CPU).  In my own tests, the shader engine accounts for a bit over 1% of my CPU time (and a small fraction of the overall Starsector load), and some others can confirm this on their machines as well.  What are your specs?

P.S. Some types of documentation are just impractical to make.  I suggest reading some of the tutorials for LWJGL, because giving full documentation for this would require me to basically teach the user OpenGL.  I don't have that kind of time; you can write textbooks on that subject.  The best I can do is provide ample examples, and at some point I'll be commenting the sample shaders a lot more.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: xenoargh on May 06, 2014, 01:53:29 PM
It's not the OpenGL stuff that's confusing, it's the "how to connect parts" that is confusing.  Say I write a particle system in an EveryFrameCombatPlugin and I want it to use a shader; now what?  It's not obvious how I connect the bitz; I see ShaderHook but there isn't a general-purpose example of this.

Performance-wise, I'm running on a quad-core Athlon II, 3300MHz per core (not that it matters, since it's not in its own thread) and a reasonably fast ATi GPU (not that that matters, at no time is that the chokepoint). 

I think you're not torture-testing adequately, so you're not seeing real loads. 

Check out performance with Vacuum- open it up and profile it, go to Missions, select Random Battle, and you'll see. 

When huge numbers of projectiles are involved, it's vastly more expensive than anything else; you need to reduce the n^2 load very considerably for it to be reasonably efficient, and the fast way to do that is to do distance culling via GetDistanceSquared() before bothering with the relatively-expensive process of evaluating string comparators, etc.

Trust me, this is something where reducing the search domain before anything else is vital.  Anyhow, I'll try to get to it when I can get to it, if you're not convinced; I doubt if it'll require major refactoring.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: Dark.Revenant on May 06, 2014, 02:18:15 PM
Are you even using the version in this thread?  The one I PMed you last week is really old and you should not even be getting lights in Vacuum in the first place because there is no light data set up for it.

The projectile tracking code is very deliberately O(n) because it uses linked hash maps/sets, which has O(1) iteration and O(1) insertion/searching.  The only O(n^2) operations are the operations that happen once when a projectile is destroyed, and even then it is only actually O(n^2) if every projectile is destroyed simultaneously.  This can be made O(n) but the overhead involved is not worth it.

I have tested the performance with Exigency fleets in random battle, involving hundreds of tiny lighted missiles flying about at all times.  I threw in my mega-MIRV that shoots 252 missiles just for kicks.  Shaders on/off made absolutely no CPU impact.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: Morrokain on May 06, 2014, 03:53:10 PM
I don't have time to test it atm, but this looks very well done and should really help the game graphically!

Nice Work!
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: xenoargh on May 06, 2014, 05:12:59 PM
Quote
Are you even using the version in this thread?
Yes, and I am getting light data from the few beams that share name strings with Vanilla, so it's working, it's just slowing my framerate to a crawl :)

Anyhow, I'll put up profiler shots here in a bit, finishing my quick-fix patch :)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: Debido on May 06, 2014, 05:20:49 PM
There may be something unique to Vacuum causing it, I have played with ShaderLib on a absolute cluster fudge of a DAKKA mayhem with Eternal Nox's largest battle with just as many if not more projectiles than you see in Vacuum, didn't really go below 20FPS during the height of the battle.

Xeno, can you also post the profile files from Netbeans? Screenshots are one thing, but having the profiles so they can be directly interrogated in another copy of Netbeans is even more useful in helping to diagnose this.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: xenoargh on May 06, 2014, 05:25:16 PM
Sure, lemme get the patch done / out.  Soon :)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: xenoargh on May 06, 2014, 06:03:53 PM
OK, tried another run, NPS is here (http://www.wolfegames.com/TA_Section/vacuum_with_shaders.zip).

1.  Re-tested, and confirmed that I'm seeing big CPU hits here.  It's not quite as bad as I feared (but wait); usage is just right around the same as the entirety of Advance otherwise (i.e., all the AIs and special systems and weapons code and Alex's code combined).

2.  Whatever is going on, it's causing huge surges in CPU at odd times.  

I'm seeing huge drops (like 30 FPS in a Sim fight between a Venture w/ drones vs. a Conquest) when certain weapons are firing, but not others.  Machinegun projectiles and rockets cause some big FPS hits, but the Glaug Thermal Gun, which obviously wouldn't be listed, doesn't, even though it was spitting out similar numbers of projectiles.  Beams appear to be moderately laggy inherently; just 4 HILs is a 10 FPS hit in a 1 vs. 1.

See the profile?  Yeah.  That wasn't what I was expecting to be the chokepoint, either :)

[attachment deleted by admin]
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: Dark.Revenant on May 06, 2014, 06:40:55 PM
Your profiler output shows that the entire lighting engine is, in sum total, about 25% slower than LazyWizard's Combat Radar.  The lights comprise roughly 23% of the Starsector advance() pipeline's sum CPU cost.

In fact, your performance reports suggest that you are severely GPU-bottlenecked.  Beams, for example, are *easier* on the CPU than projectiles, but use a more complicated shader due to being line sources instead of point sources.  I ask again: what is your graphics card?  I need to determine what kind of graphics settings to include in later versions, since you seem to have found yourself beyond the point where the GPU bottlenecks the CPU.  Making beams lower-priority on the sorting list of death for which lights to draw and which to not draw seems like a logical first step, but is there anything you can recommend in terms of user settings?
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: xenoargh on May 06, 2014, 07:04:20 PM
I'm using a Radeon 5700; most modern games are at acceptable framerates, although I can't push settings up to max on the very latest things.  I'm having a lot of trouble with the idea that it's the GPU, but I haven't read the GLSL so I have no idea how much filtering, etc. is going on there.

Anyhow, I guess I'll take a look at the lights setting and see where the limits are.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: xenoargh on May 06, 2014, 07:29:47 PM
It's not the GPU, the CPU is definitely the bottleneck.

45 FPS, and there is only one live ShipAPI in this entire scene, and four beams.  The minute the beams are off, we're back to 60.  See the idle there?  It was 45%+ before the beams came on.

(http://www.wolfegames.com/TA_Section/ss_shaders_lights01.jpg)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: Dark.Revenant on May 06, 2014, 07:33:08 PM
It can't possibly be a CPU bottleneck under those conditions.  It's the GPU.  It seems to be yet another issue with AMD cards, but it's hard for me to figure out why; I've tried GPU ShaderAnalyzer (AMD tool) and it just tells me the shader is within the bounds I expected it to be.

By the way, the idle % counter is inaccurate.  Check CPU usage via a monitoring tool or even just the clt-alt-del screen.  And I seriously suggest you look at your GPU load % via monitoring tool.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: Alex on May 06, 2014, 07:57:33 PM
By the way, the idle % counter is inaccurate.  Check CPU usage via a monitoring tool or even just the clt-alt-del screen.  And I seriously suggest you look at your GPU load % via monitoring tool.

(The "% idle" is not CPU idle time and isn't intended to be. It shows the percentage of time the game spends sleeping. It doesn't differentiate between time spent on the GPU vs the CPU. So yeah, if you want to know what the CPU usage is, use an external monitoring tool.)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.02)
Post by: xenoargh on May 06, 2014, 08:19:38 PM
If the GPU is the bottleneck here, then something is fundamentally borked, yeah.

This is why I bought ATi; if I have to rework stuff at home, I want to do it on the hardware most likely to have serious problems, lol.

Tested with an 8-light limit; same results.  15 FPS lost, and all I have is 4 lasers running.  

I still have nagging doubts, though, based on the specific function call in the profile; most of the time is spend on glCopyTexImage2D; that sets off some alarm bells; if you're just doing ping-pong, that's just one copy of the main frame buffer to the FBO...
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.03)
Post by: Dark.Revenant on May 06, 2014, 08:27:28 PM
I am a *** failure.

Yeah, it was glCopyTexImage2D; according to LazyWizard, there's a warning in the nVidia documentation (wut) that glCopyTexImage2D should always be substituted with glCopyTexSubImage2D on subsequent frames.  Apparently this is Graphics Coding 101 and I'm a phony.

Anyway, updated; see the OP.

Alpha v1.03 (May 6, 2014)
- Added method to LightData: void readLightDataCSVNoOverwrite(String localPath)
- Added method to ShaderLib: int getScreenTexture()
- Added "maximumLineLights" option to settings.json (default 50)
- Serious AMD performance issue resolved; will be slightly faster for nVidia users as well
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.03)
Post by: xenoargh on May 06, 2014, 08:30:52 PM
Dude, it's cool; if this stuff was easy, everybody would do it.  Let's see if it's happy now.

<tests>
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.03)
Post by: xenoargh on May 06, 2014, 08:35:38 PM
Solid.  No lag, practically no performance hit. 

Haven't done a gargantuan profiling run yet, let alone trying for something like full implementation with Vacuum's weapons, to see just how laggy it gets... but it was like night and day with the simple test.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.03)
Post by: Foxer360 on May 06, 2014, 09:03:53 PM
I'm happy to report I have no more FPS issues with the latest dev. A solid 60 even with multiple ships!
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.03)
Post by: xenoargh on May 06, 2014, 09:17:12 PM
Did big profiling run (no full integration yet, that's going to take a few days, most likely), and it was an infinitesimal fraction of the entire load.  Great!  Now, that isn't full integration with all of the Vacuum weapons and all that, but baby steps...

So...

1.  Is there a generic way to call it from an EveryFrameCombatScript and create a light arbitrarily?  I'm thinking engines and other special FX stuff, like having a blinky light that's actually a light and doing lights procedurally (for example, ship deaths) and all that kind of thing where normally I've been using particles.

2.  Really would like an example of how to hook up the shader stuff to EveryFrameCombatScript or suchlike via the hook; this engine needs a fast particle system for ultra-lulz explosions.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.03)
Post by: Dark.Revenant on May 06, 2014, 10:08:02 PM
1. yourLight = new StandardLight();
LightShader.addLight(yourLight);

You can also make other LightAPI objects to add for any kind of custom behavior you want.

2. Just use the examples I show.  ShaderHook is an internal thing. Use ShaderLib.addShaderAPI(new yourShader());

yourShader implements ShaderAPI and does everything you want it to, which can include a particle system if you want.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.03)
Post by: billi999 on May 07, 2014, 04:18:51 AM
Is it possible to use additional sprites with the pixel/fragment shader with this? I can't stop imagining ships with RGB->XYZ normal maps to simulate 3D-like diffuse lighting.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.03)
Post by: Dark.Revenant on May 07, 2014, 05:21:09 AM
Yes.  I'll implement a loader for those so I can insert it into the foreground drawing loop, if sprites are made for that purpose.  I'd be more interested in seeing materials maps, though.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.04)
Post by: Dark.Revenant on May 08, 2014, 02:33:50 PM
Updated.

Alpha v1.04 (May 8, 2014)
- Added "brightnessScale" option to settings.json (default 1.0)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.04)
Post by: Dark.Revenant on May 11, 2014, 02:32:58 PM
Added a small integration tutorial on the first post to help modders add lights to their mods.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Dark.Revenant on May 11, 2014, 08:19:38 PM
Update!

Alpha v1.05 (May 11, 2014)
- Fixed most of the issues related to animated weapons causing flickering lights
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: FlashFrozen on May 11, 2014, 09:56:48 PM
An example of Neutrino working with Pretty lights and stuff.

(http://i.imgur.com/JVLJP03.png)

Spoiler

(http://i.imgur.com/FLx06eb.png)(http://i.imgur.com/7iC9B9u.png)
(http://i.imgur.com/qsYwrZc.png)(http://i.imgur.com/kNjJabr.png)
(http://i.imgur.com/3nYwC1B.png)


[close]
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: theSONY on May 12, 2014, 01:54:29 PM
i got weird effect with Uomoz mod
Spoiler
(http://i.imgur.com/LxVnnwp.png)
[close]
Spoiler
(http://i.imgur.com/T6gU2UR.png)
[close]
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: ValkyriaL on May 12, 2014, 02:07:02 PM
Space needs more christmas trees...

Spoiler
(http://i.imgur.com/QnJAljK.jpg)
[close]
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Dark.Revenant on May 12, 2014, 03:24:06 PM
i got weird effect with Uomoz mod

This isn't a problem on my end.  Clearly one of the mods in UsS is doing some improper opengl.  I'll ask Uomoz.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Nanao-kun on May 12, 2014, 03:29:15 PM
I'm using Uomoz's new version as well, but I'm not getting any problems.

Space needs more christmas trees...

Spoiler
(http://i.imgur.com/QnJAljK.jpg)
[close]
But there's no star on top! >:(
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Debido on May 12, 2014, 03:31:22 PM
i got weird effect with Uomoz mod
Spoiler
(http://i.imgur.com/LxVnnwp.png)
[close]
Spoiler
(http://i.imgur.com/T6gU2UR.png)
[close]

(http://cdn.memegenerator.net/instances/500x/49745519.jpg)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Dark.Revenant on May 12, 2014, 05:55:20 PM
Come to think of it, theSONY, what is your GPU?  Does this happen with no mods other than shader lib installed?
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Sundog on May 12, 2014, 07:21:36 PM
Seems like the compatibility option requires a compiled ModPlugin to work without ShaderLib. I may be wrong, but I can't think of a way to get janino to compile it. Might be worth making a note of in the 'how to use - for modders' section.

The lighting shader looks great btw  :)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Cycerin on May 13, 2014, 05:06:05 AM
i got weird effect with Uomoz mod
Spoiler
(http://i.imgur.com/LxVnnwp.png)
[close]
Spoiler
(http://i.imgur.com/T6gU2UR.png)
[close]

(http://cdn.memegenerator.net/instances/500x/49745519.jpg)

Goddamn it, I hate the fact I laughed at this
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 11:57:53 AM
Hey, just tried to set up early implementation stuff to get it ported in; finally have a bit of time free today.

SRC appears to be incomplete; it's missing renderOrder and other things and I can't rebuild the jar.  Is there stuff that's black-box in the jar or did I just do it wrong?  I'd kind of prefer to have all the bits and parts, given what I'd like to do with this :)

Also, can it please read from shaderLib_settings instead of the very-generic "settings"?  That's just asking for trouble down the road with somebody else's utility.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 12:29:57 PM
Second try.  

Shaders.java is in /jars, mod_info:

Code
"jars":[
"jars/LazyLib.jar",
"jars/Vacuum.jar",
"jars/Shaders.jar"
],

CSV named vacLights is in data/lights.

In ModPlugin:

Code: java
    @Override
    public void onApplicationLoad() throws Exception
    {
        ShaderLib.init();
        LightData.readLightDataCSV("data/lights/vacLights.csv");
    }

It compiles OK, but it doesn't do anything.  

The lighting data works when ShaderLib is separate from the mod (i.e., if I just modify core_light_data), but if I integrate it, nothing; it's like it gets called via init, but nothing ever executes.  It does crash if it's missing, though, lol.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Dark.Revenant on May 16, 2014, 01:17:44 PM
You're not supposed to rebuild the library.  The source is provided so people can understand what's going on.  Everything you need is provided via API.  I'll be including the src as part of the JAR file in future releases to make this clearer.

In any case, if you want lights, it works fine just with shaderlib as its own original mod with Shader.jar selected as a library for your Vacuum project.

I repeat: Unlike LazyLib, ShaderLib *MUST* be its own mod.  You can of course provide mods that extend its functionality, but not replace it.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 02:07:19 PM
Quote
Unlike LazyLib, ShaderLib *MUST* be its own mod.
Er... why?  I mean, there are very good reasons why I don't want external dependencies for a big, complex TC...
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Dark.Revenant on May 16, 2014, 02:28:06 PM
That's reasonable; you can merge the files with your TC to avoid such a dependency.  However, it is not explicitly designed for this, so be warned.  Also, you should under no circumstances be rebuilding the mod.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 02:35:50 PM
TCs are a pain, lol.

Anyhow, I just tried that, that's what I was saying on the previous page. 

I'll take another whack at that tomorrow but integration of it in the same fashion as LazyLib just didn't work at all, which is weird.  No crashy-crash, but no lights.

IIRC we had a couple of issues getting CombatRadar working, too; something about the integration of the ModPlugin and initialization (IIRC).
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Dark.Revenant on May 16, 2014, 02:37:13 PM
You should copy the contents of the ShaderLib modplugin into yours, since the original one won't run if it's in your mod.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 06:24:31 PM
Got it working (had to have one last go after supper, lol).  I was missing the line in data/config/settings.json ... <facepalm>

So, er, now I just have to figure out addLight() and I can do some stuff.  Very exciting :)

Oh, and with lights, given that there's a hard cap, I don't suppose there's a priority level or a way to force stuff into the queue?  Bit of a bummer if a giant nuke's lighting didn't show up, for example.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 06:49:31 PM
Oh, wait.  Still not working.  Had ShaderLib running as its own thing  ::)

Turned that off, and nothing.

So I went and added this to the ModPlugin:

Code
        ShaderLib.init();

        if (ShaderLib.areShadersAllowed()) {
            ShaderLib.addShaderAPI(new RippleShader());
            ShaderLib.addShaderAPI(new InvertShader());
        }

        if (ShaderLib.areShadersAllowed() && ShaderLib.areBuffersAllowed()) {
            LightData.readLightDataCSVNoOverwrite("data/lights/core_light_data.csv");
            ShaderLib.addShaderAPI(new LightShader());
        }     

I got back an error from the IDE; it says that addShaderAPI's type is erroneous.  What does that mean?
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Debido on May 16, 2014, 06:51:16 PM
Got it working (had to have one last go after supper, lol).  I was missing the line in data/config/settings.json ... <facepalm>

So, er, now I just have to figure out addLight() and I can do some stuff.  Very exciting :)

Oh, and with lights, given that there's a hard cap, I don't suppose there's a priority level or a way to force stuff into the queue?  Bit of a bummer if a giant nuke's lighting didn't show up, for example.

Xeno, were you not going to look at creating a Shader pack library mod that extends the ShaderLib by using the API's made available by it?

By forking your own ShaderLib version you're making it difficult to update it in future when new ShaderLib versions come out, there is no reasonable architectural reason to be creating your own code branch give the API available.

If you extend ShaderLib and make your own package of shaders, you don't have to update much of your code, other than updating as necessary to meet changes in the API. Also by making a portable library of shader programs they can be shared and utilised in other mods rather than being hard coded to Vacuum.

Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Dark.Revenant on May 16, 2014, 07:01:34 PM
Which IDE are you using?  It may be improperly casting this stuff.  For example, addShaderAPI takes a ShaderAPI an interface that LightShader implements.

Also, lights are automatically sorted by a formula involving size and intensity, so you shouldn't have to worry about huge nuke lights being skipped.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 07:18:27 PM
I'm using NetBeans.  It does appear to be something of that nature; not sure how to get it to cast to the correct type though.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Dark.Revenant on May 16, 2014, 07:31:12 PM
Try manually casting it?  You might not have the correct classes imported in the header either.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 07:34:01 PM
All this?

Code
import org.dark.shaders.invert.InvertShader;
import org.dark.shaders.light.LightData;
import org.dark.shaders.light.LightShader;
import org.dark.shaders.ripple.RippleShader;
import org.dark.shaders.util.ShaderAPI;
import org.dark.shaders.util.ShaderLib;

ShaderLib.addShaderAPI((ShaderAPI) new RippleShader());

Still unhappy with me.  Really puzzling.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Dark.Revenant on May 16, 2014, 08:02:48 PM
Can you give the full, verbose compiler error?
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 08:39:26 PM
¡Ay, Caramba!

I redid everything from scratch.

It decided it wants to compile this time, even though it didn't want to last time, and even though NetBeans has red-flagged it, and it appears to work.

I'm double-testing.  Surely this is a mistake or I've left something else still active, or something.  I have no idea what is allowing it to compile now; I just did all of the install steps from scratch, and it's not happy with those lines and still says they're erroneous... but it compiled.

<tests s'more>

It works.  It shouldn't be working, but it appears NetBeans has decided to let it compile.  It's still red-flagged, but it's working and it doesn't complain when it compiles.

I have no clue why that would be so; it didn't want to compile last time at all.  Weird.  Meh.  Now to see what happens when I try out addLight, lol...
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 08:50:30 PM
Still red-flagged, but it's still working.  Testing out addLight now...
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: Dark.Revenant on May 16, 2014, 09:11:28 PM
You have tried restarting NetBeans, right?
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: LazyWizard on May 16, 2014, 09:15:30 PM
Xeno: is lwjgl.jar (and any other jar ShaderLib requires) included as a library in your Netbeans project?

I had a similar Netbeans issue last week (red flag, code still compiled) with a project using LWJGL's controller input classes. It turned out I had to include jinput.jar as a library, even though nothing from JInput was exposed through the LWJGL classes I was using.
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: xenoargh on May 16, 2014, 10:32:06 PM
@DR:  Yup.  Several times.  While saying atrocious things ;)

@LW:  Huh, that's weird.  I just tried putting in jinput (that would make sense, IIRC there's a keybinding involved somewhere in the code here, and I have the lwjgl stuff in use to support Combat Radar).  

Still getting a red flag.  Still compiles.  Bizarre.


Anyhow... did a few more tests.  Must sleep now.



AddLight works, and it's cool... but there are some features I'd like to have.

1.  I'd like to be able to create relationships between StandardLights and WeaponAPIs and be able to move them.

Once a light is created via StandardLight, there doesn't appear to be a way to move it around easily or attach it to something that's not a CombatEntityAPI's center point.  

You can attach it to a CombatEntityAPI, but not to a WeaponAPI or an offset, and you can't give it a velocity once it's been passed to LightShader.

That's a bit inconvenient, as a rapidly-moving ship may move well out of the area the light effects well before the light does anything, or, worse, if the TTL is too long, cause artifacts.

So for things like weapon lights or special FX with invisible WeaponAPIs, you have to use a very short-duration light, which means creating more lights per second; I don't know how expensive it is to create a light, but surely it's cheaper to move it; then the light could be created a lot less frequently and be faded out immediately if it can't find its attachment.  

Or perhaps this needs another type of solution entirely, specifically for attached point lights, beams and cones; I realize that LightShader's primarily about pew-pew stuff :)

2.  Shot creation lights would look even nicer if they used the barrel offset of the weapon, not the position of the bullet.

Oh, and... one minor thing about the pew-pew system that came up in early testing; when shot lights are being created, they're being created at the projectile's point, not the barrel offset of the weapon.  This can lead to some issues with getting the light well-matched with the barrel for a nice look, especially with big projectiles.

Take a look at the code I wrote for the Autofire AIs; it shows how to get the barrel lengths, and those could be stored in an array, or we could input that manually into the CSV.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.05)
Post by: Dark.Revenant on May 16, 2014, 11:38:28 PM
If you want any of those behaviors, just make your own LightAPI implementation that defines those behaviors and pass it to LightShader instead of a StandardLight.  Or make a class that extends StandardLight with the functionality (especially by overriding advance()).  Etc.

By the way, creating lights is not expensive at all.  The computational difference is impossible to notice in practice.

Cone lights are simply not supported at all, yet.  Each type increases the complexity of the shader, you know.  I doubt there are many situations even in mods where a cone light would do anything that point or line lights can't do, anyway.

I am not going to do even more data storage operations to store barrel lengths, especially since the working difference between the initial projectile position and the tip of the barrel is small, outside of rare modded projectiles.  The current method is the only method that works well for multiple barrels, so I am going to add another csv column for flash-offset (i.e. how many pixels behind the projectile to spawn the flash) to avoid any potential issues.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.1) (Distortion!)
Post by: Dark.Revenant on May 17, 2014, 06:41:15 AM
Update!

ShaderLib Alpha v1.1
Download Alpha v1.1 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.1.zip)
(MediaFire Mirror) (https://www.mediafire.com/?i2en9ub3siukk8z)

Alpha v1.1 (May 17, 2014)
- Universal Distortion Engine (DistortionShader) added
- DistortionAPI added
- Added WaveDistortion type
- Added RippleDistortion type
- Added "flash offset" column to lights CSV (how many pixels behind the projectile to spawn the muzzle flash, which should not be needed for most weapons; ignored for beams)
- Added advance() to LightAPI
- Internal shaders externalized to the shaders folder (modify at your own risk)
- Some additional documentation added
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: Dark.Revenant on May 17, 2014, 07:54:49 AM
Quick update!

ShaderLib Alpha v1.11
Download Alpha v1.11 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.11.zip)
(MediaFire Mirror) (https://www.mediafire.com/?bvgfvel65jk779v)

Alpha v1.11 (May 17, 2014)
- getArcStart and getArcEnd added to DistortionAPI (allows only a certain subset of the direction vectors to apply)
Title: Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
Post by: theSONY on May 18, 2014, 10:01:46 AM
Come to think of it, theSONY, what is your GPU?  Does this happen with no mods other than shader lib installed?

i got Radeon 1300/1550
& yes, this accures durning your mod only, it only apears during  fights & if something is going on (when effects are active)
also this appears on latest mod version also (1.11)
i was trying to turn off Lights & distortion from "Settings.json" & still the same
but also thx for Options to also disable everything, i can still play on Uomoz's collection so BIG thx again
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: Dark.Revenant on May 18, 2014, 11:01:21 AM
That's strange; I found a bug where disabling lights/distortions did nothing.

Fortunately, lights and distortions are the only effects currently used. In the next version, you will be able to actually disable those shaders individually.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: xenoargh on May 18, 2014, 11:02:47 AM
Just tried the new build, but it won't compile any more.  There's no /src, so I'm not sure what changed in the modplugin, but obviously I need to change stuff again :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: xenoargh on May 18, 2014, 11:05:28 AM
OK, pulled that out of the jar... NetBeans is unhappy with me again, doesn't seem to know how to point at the resources, but let's see if it'll compile, lol.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: xenoargh on May 18, 2014, 11:16:48 AM
OK, we're good again.  Still lots of work to do, making the lighting stuff do all the stuff I'd like, but baby steps.

To use distortions, instead of something like StandardLight, we create a new RippleDistortion / WaveDistortion (or write a new class implementing DistortionAPI), correct?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: theSONY on May 18, 2014, 11:24:01 AM
That's strange; I found a bug where disabling lights/distortions did nothing.

Fortunately, lights and distortions are the only effects currently used. In the next version, you will be able to actually disable those shaders individually.
well i disable Lights & distortions from the settings,json 1'st i set "false" on # LIGHT OPTIONS # start the game ( your mod only ) & still i got StarSeptiontm :D
& then i set "false" on # DISTORTION OPTIONS # (setting true on lights at the same time) & start the game & still Starseption
if this helps i also got a little glitches wiht the oryginal vanila game , like problems with backgrounds or some picturs that appears ehen docking at the station,but as far as i remember this is some resolutions problems
but as i wrote before, it's not a problem for me as long as i can run the game with mods :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: xenoargh on May 18, 2014, 02:00:23 PM
Another feature request.  It'd be nice if the muzzle flashes could get auto-scaled downwards for fighters.  A 30-radius flash may look really great on a Destroyer, but it floods a fighter's entire sprite. 

I know that's a perfectionist thing to ask for, but I think it'd really help polish the look and it's straightforward and shouldn't cost much if anything- getSource() for the projectile, then isFighter / isDrone and if true, scale down :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: ValkyriaL on May 18, 2014, 02:07:42 PM
or you could just change the weapon light radius in the light.csv. :o
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: Dark.Revenant on May 18, 2014, 03:06:39 PM
Another feature request.  It'd be nice if the muzzle flashes could get auto-scaled downwards for fighters.  A 30-radius flash may look really great on a Destroyer, but it floods a fighter's entire sprite. 

I know that's a perfectionist thing to ask for, but I think it'd really help polish the look and it's straightforward and shouldn't cost much if anything- getSource() for the projectile, then isFighter / isDrone and if true, scale down :)

I recommend using a different projectile for fighters, assuming you're already using a different weapon (which I recommend in many cases, considering the capital-sized vanilla muzzle flash...) that lacks a flash light.

OK, we're good again.  Still lots of work to do, making the lighting stuff do all the stuff I'd like, but baby steps.

To use distortions, instead of something like StandardLight, we create a new RippleDistortion / WaveDistortion (or write a new class implementing DistortionAPI), correct?

Correct.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: xenoargh on May 18, 2014, 04:01:39 PM
Quote
assuming you're already using a different weapon (which I recommend in many cases, considering the capital-sized vanilla muzzle flash...) that lacks a flash light.
I generally don't; it just multiplies the maintenance hassles when you have so many weapons to balance for :)

Anyhow, it's a straightforward change:
Code: java
                // Flash light
                if (data.hasFlash) {
                    if ((float) Math.random() <= data.chance) {
                        StandardLight light = new StandardLight();
                        light.setIntensity(data.flashIntensity);
                        light.setColor(data.flashColor);
                        if(proj.getSource() != null){
                          if(proj.getSource().isFighter() || proj.getSource().isDrone()){
                              light.setSize(data.flashSize / 3f);
                            } else {
                              light.setSize(data.flashSize);
                            }
                        }
                        if (Float.compare(data.flashOffset, 0f) != 0) {
                            double facing = proj.getFacing() - 180.0;
                            if (facing < 0f) {
                                facing += 360.0;
                            }
                            facing = Math.toRadians(facing);
                            Vector2f offset = new Vector2f((float) Math.cos(facing), (float) Math.sin(facing));
                            offset.scale(data.flashOffset);
                            Vector2f.add(proj.getLocation(), offset, offset);
                            light.setLocation(offset);
                            ....
So, one null test, one boolean, a branch and a math step.  

On the particles, I'm reducing them to no more than three, even for big stuff; the muzzle lights, if adjusted properly, make lots of particles irrelevant, and I'm looking forward to the performance improvements :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: Dark.Revenant on May 18, 2014, 04:15:47 PM
I am not doing a hidden conditional change in light size in the data path.  This is a design decision.

So I'll put a scalar in settings.json, which will be default 1.0 but you can set it to whatever you want because it's integrated in Vacuum anyway.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: xenoargh on May 18, 2014, 04:18:56 PM
Works for me; totally understand about not wanting a hidden Thing, I just figured that's about right for most use cases :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: xenoargh on May 18, 2014, 06:10:47 PM
Caught a minor bug; under some circumstances, it appears that intensity can go below zero before a light is removed from the sim, resulting in a bright flash.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: Dark.Revenant on May 18, 2014, 06:48:27 PM
That does not help if you don't list those circumstances.

In any case, it occurred to me that there is no way to flag a LightAPI to be removed.  I'll be fixing this oversight on tonight's update, by adding a boolean return to advance() that flags whether it should be destroyed that frame.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: xenoargh on May 18, 2014, 09:56:19 PM
Well, it's observable when you hit a ship a glancing blow, that I know for certain.  You can see these bright flashes of very intense color briefly then.

It's pretty clear that something's causing the values to leap upwards; perhaps the shader doesn't check to make sure that the value of the intensity is > 0 and the StandardLight isn't getting removed in time, or it's not handling the lifetime correctly?  I'll take a look at that when I can; been too busy with RL tonight, unfortunately. 

Another feature request; it'd be nice to apply the offset to certain projectiles while they're in flight- rockets and missiles would look good that way.  A boolean check vs. a CSV value to use / not use the offset should be all that's needed :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: Dark.Revenant on May 18, 2014, 10:21:08 PM
That can only happen if the fadeout time for the attached light is shorter than the projectile's actual fade out time. I'll add a check to ensure the intensity/size are clamped to zero in the final phase.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: xenoargh on May 19, 2014, 02:38:52 PM
That makes sense; all of the projectiles in Vacuum have been clamped to 0.25 seconds of fadeout time, and projectiles that do a hit go through a brief fadeout :)

Anyhow, should get to testing distortion implementations soon.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.11) (Distortion!)
Post by: Dark.Revenant on May 19, 2014, 05:15:44 PM
Upcoming in a few hours: Big update with a few infrastructure changes and most importantly: BLOOM
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: Dark.Revenant on May 19, 2014, 09:30:54 PM
Now with Bloom!

Spoiler
(http://i.imgur.com/QbZd2it.png)
[close]

ShaderLib Alpha v1.2
Download Alpha v1.2 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.2.zip)
(MediaFire Mirror) (https://www.mediafire.com/?6buxv0vj8228gxc)

Alpha v1.2 (May 19, 2014)
- Bloom effect added to Lighting Engine (for situations where the lights are particularly bright)
- Added "enableBloom", "bloomQuality", "bloomMips", "bloomScale", and "bloomIntensity" options to settings.json
- Added methods to StandardLight: void setVelocity(Vector2f velocity), void setVelocity2(Vector2f velocity), Vector2f getVelocity(), Vector2f getVelocity2(), Vector2f setOffset(), Vector2f getOffset()
- Added methods to WaveDistortion and RippleDistortion: void setVelocity(Vector2f velocity), Vector2f getVelocity()
- Added methods to ShaderLib: void drawScreenQuad(float scale), void copyScreen(int texture, int textureUnit)
- Added "offset" column to lights CSV (how many pixels behind the projectile to spawn the standard light, which may be useful for missiles; ignored for beams)
- Added "fighterBrightnessScale" option to settings.json (default 0.5)
- Added two arguments (int texture, int textureUnit) to ShaderLib.screenDraw()
- Updated WaveDistortion texture (should act properly now; to get a sphere, set the intensity to 1/4 the size)
- Updated RippleDistortion texture
- Fixed enableLights and enableDistortion settings options
- Updated LightAPI's advance method to return a boolean representing whether it should be destroyed that frame or not
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: xenoargh on May 19, 2014, 09:49:28 PM
Sounds solid; hopefully it didn't break too much of what I've been doing; I am pretty excited about some of the stuff I've gotten done ;)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: xenoargh on May 19, 2014, 11:39:34 PM
Tried out the distortions.  Not sure what they're quite supposed to do yet.  I built one like this:

Code: java
            
        for(int i = 0; i < 10; i++){
            WaveDistortion distortion = new WaveDistortion();
            distortion.setLocation(point);
            float timer = MathUtils.getRandomNumberInRange(0.5f,1.5f);
            distortion.fadeOutIntensity(timer);
            distortion.setSize(MathUtils.getRandomNumberInRange(150f,350f));
            distortion.setLifetime(timer);
            DistortionShader.addDistortion(distortion);
        }
I was expecting it to cycle the rings and do a ripple effect, but there doesn't appear to be a wave cycle timer- it's just one wave per instance.  So I tried this but it didn't look anything like what I expected.

This produced some really huge distortions that then popped back to normal very suddenly, which didn't look terribly good.   It also didn't seem to distort the background stars?

I was hoping to make a nice bunch of outgoing ripples from the point, but it appears that if I want to do that, I need to implement EveryFrameCombatPlugin, maybe?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: Dark.Revenant on May 20, 2014, 12:14:48 AM
First of all, if you want a ripple effect, it's best to use RippleDistortion, since that will actually produce a ring shape.  Each frame (it's 60 total) is a thinner version of the ring; if you increase the size and play the frames, it will look like an expanding ripple.  If you want it to cycle, extend it with an override of advance that loops the animation, size, and intensity instead of killing the object.

Second, you shouldn't set a lifetime in this case; it will be removed when it finishes fading out.

Third, you didn't actually give that distortion a starting intensity (it defaults to 20 units if you don't).  Multiple overlapping distortions does not produce an entirely reliable effect; it will look better if they overlap less (such as concentric rings).

Fourth, you didn't make it change size, which is needed for it to actually expand outward.  To do this, set the size to some value and then fadeInSize, then set the size to some other value if you want it to begin at a size other than 0.  Setting a non-zero starting size for a fadeIn will actually shorten the fade-in time (as you might expect), so you should adjust the timer accordingly.

(You can fade in/out size and intensity independently)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: xenoargh on May 20, 2014, 10:00:21 AM
I think I need an example, lol.  I tried this:

Code: java
        RippleDistortion distortion = new RippleDistortion();
        distortion.setIntensity(1f);
        distortion.setLocation(point);
        float timer = MathUtils.getRandomNumberInRange(0.1f,0.5f);
        distortion.fadeInIntensity(0.1f + timer);
        distortion.fadeOutIntensity(1.0f + timer);
        distortion.setSize(MathUtils.getRandomNumberInRange(500f,750f));
        distortion.fadeInSize(1.0f + timer);
        DistortionShader.addDistortion(distortion);

Expectation:  Big wave starts from center and rapidly distorts everything around it, moves out to big radius, fades.

Result:  Nothing obviously visible happens to the scene; even worse than the last one, lol :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: xenoargh on May 20, 2014, 10:26:16 AM
Tried messing with the intensity settings and capped the timers to make sure it's all strict.  Still not really getting much if any distortion:

Code: java
        RippleDistortion distortion = new RippleDistortion();
        distortion.setIntensity(45f);
        distortion.setLocation(point);
        distortion.fadeInIntensity(0.1f);
        distortion.fadeOutIntensity(2f);
        distortion.setSize(MathUtils.getRandomNumberInRange(500f,750f));
        distortion.fadeInSize(2f);
        DistortionShader.addDistortion(distortion);
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: Dark.Revenant on May 20, 2014, 02:05:43 PM
That's because you are calling fadeIn and fadeOut immediately after the other.  Instead, call fadeInIntensity(0.1f) and then setAutoFadeIntensityTime(1.9f) and setLifetime(0), and make sure you're setting the animation to something, perhaps with setFrameRate(30f).
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: 603bill on May 20, 2014, 02:42:18 PM
I've got an issue where the shaders don't line up with the ships.  I'd post some screenshots but I cant figure out how that business works.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: Dark.Revenant on May 20, 2014, 03:13:32 PM
That's a known, and completely unfixable issue.  Unfortunately, you'll just have to deal with it until the render order fixes come in with the next Starsector update.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: xenoargh on May 20, 2014, 04:49:20 PM
@D.R. Cool, I'll try that.

<tries>

Success, at last! 

Code sample for the curious; this produces a nice fat distortion ripple over a 2-second period.
Code: java
        RippleDistortion distortion = new RippleDistortion();  
        distortion.setIntensity(45f); 
        distortion.setLocation(point); 
        distortion.fadeInIntensity(0.1f); 
        distortion.setAutoFadeIntensityTime(1.9f);
        distortion.setLifetime(0f);
        distortion.setFrameRate(30f);
        distortion.setSize(MathUtils.getRandomNumberInRange(500f,750f)); 
        distortion.fadeInSize(2f); 
        DistortionShader.addDistortion(distortion);
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: Dark.Revenant on May 20, 2014, 05:16:25 PM
I just remembered that it won't actually consider the lifetime is over until *all* fades are done, so these lines are actually doing nothing:

        distortion.setAutoFadeIntensityTime(1.9f); 
        distortion.setLifetime(0f);

Since it is producing an acceptable effect without fading intensity out, you can safely delete those lines.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: xenoargh on May 20, 2014, 05:17:44 PM
KK.  Will test as soon as I'm done with the other bit of the thing I'm working on :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: xenoargh on May 20, 2014, 07:14:12 PM
This looks really good with a couple of ripples as part of the whole thing :)
Spoiler
(http://www.wolfegames.com/TA_Section/ss_nuke01.jpg)
[close]
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: Debido on May 20, 2014, 08:46:04 PM
That's one gorgeous looking explosion.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: Cycerin on May 21, 2014, 03:02:16 AM
Nice bloom, too.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: xenoargh on May 21, 2014, 10:36:19 AM
Actually, I played with the bloom and it's at fairly conservative settings.  Bloom's going to be a little more important if we have per-ship / per-weapon materials.

I may write a custom bloom shader at some point, that's something I've done before and I'd like to play around with the filter taps and the ramps a bit to get it nice and tight.  Still just trying to get lights and stuff integrated atm, though; it's a pretty huge job with all these ships and weapons :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.2) (Bloom!)
Post by: Dark.Revenant on May 21, 2014, 03:28:38 PM
If you are interested in editing the bloom shader, it's in data\shaders\bloom: bloom1-5, bloom1-7, bloom1-9, bloom1-11, bloom1-13, bloom2-5, bloom2-7, bloom2-9, bloom2-11, bloom2-13, and bloom-3

The curves are pre-built constants (otherwise the shader would be far too slow, since it would need multiple exponential calculations per pixel), so this stuff can't be made parameterizable; you have to edit it in directly.  The current lighting and bloom functions:

1. Foreground objects are rendered to a buffer with a 0-alpha background

2. Lights, the current scene, and the foreground buffer are fed into light
2.a. Illumination = sum(light magnitude * light color) * foreground pixel alpha
This makes sure only ships and stuff in the foreground are lit; this will include weapon barrels and asteroids in the next SS update.
2.b. Output Pixel = clamp((scene pixel + min(scene pixel, foreground pixel) * Illumination) / hdr, 0, 1)
hdr is 256 with bloom on, and 1 with bloom off, since bloom requires HDR (which I interpret as a 48-bit image, which is probably overkill because that allows luminosity up to 256 times higher than what a 24-bit image can provide).  Anyway, this function is important because it makes darker parts of the ship less reflective, preserving contrast, detail, and depth, and also ignores damage glow, weapon hit sprites, etc. when doing this calculation, avoiding unrealistic over-brightness.

3. If bloom is on, the render from step 2 is fed into bloom1
3.a. Output Pixel = horizontalGaussian(max(lighting scene pixel - 1/256, 0) * hdr
This outputs a hdr over-brightness map, which has been blurred horizontally via a blur kernel; in other words, if all of the pixel's components fall below the maximum drawable range, no bloom will occur.  Bloom only occurs on pixels that are brightened beyond the displayable range.  Once again, hdr is 256.

4. The render from step 3 is fed into bloom2
4.a. Output Pixel = verticalGaussian(max(horizontal gaussian pixel, 0) * intensity
This outputs a normalized over-brightness map, which has been blurred vertically via a blur kernel (completing the box blur, since it has now been blurred in both directions).

5. The renders from steps 2 and 4 are fed into bloom3
5.a Normalized Scene Pixel = lighting scene pixel * hdr
hdr is still 256.
5.b. Output Pixel = normalized scene pixel + max(1 - normalized scene pixel, 0) * bloom pixel
What this does is composite the blurred bloom pixels onto the scene.  This time, the lighting curve is the opposite as before; it has a stronger effect on darker pixels and a weaker effect on brighter ones.  This avoids washing out the ship and has a nice haze effect on the black of space.

The math is intentionally as simple as possible, for maximum performance.  Other modders are welcome to offer alternatives for the user to choose from.  Setting up these shaders to work in the first place is a job and a half for me (getting that bloom working properly and looking good in GLSL 1.1 was particularly nightmarish), but writing GLSL code is pretty easy, so don't feel intimidated.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.21) (Bloom!)
Post by: Dark.Revenant on May 23, 2014, 05:03:42 PM
Update!  See if this fixes your visual glitches and performance issues, if any.  By the way, ripples and such will sometimes be slightly off-center and I have no way of fixing that until the next Starsector update.

ShaderLib Alpha v1.21
Download Alpha v1.21 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.21.zip)
(MediaFire Mirror) (https://www.mediafire.com/?8ced4pig8iz97kv)

Alpha v1.21 (May 23, 2014)
- Update to the light and bloom shaders for clarity and slightly better performance
- Changed displayable mod name to "ZZ ShaderLib" so it loads and runs last
- Added "use64BitBuffer" option to settings.json
- Improved color depth
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.22) (Bloom!)
Post by: Dark.Revenant on May 23, 2014, 06:22:10 PM
Quick update.

ShaderLib Alpha v1.22
Download Alpha v1.22 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.22.zip)
(MediaFire Mirror) (https://www.mediafire.com/?44ulv57cp27j3kd)

Alpha v1.22 (May 23, 2014)
- Fixed a major issue on some computers involving sprite alignment
- Added method to ShaderLib: void setVanillaViewport()
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.22) (Bloom!)
Post by: xenoargh on May 23, 2014, 07:30:46 PM
Something really weird is going on now, lol; my screen's flashing every time I fire off a lighting event.  Do I need to change the initialization settings?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.22) (Bloom!)
Post by: xenoargh on May 23, 2014, 07:37:54 PM
Hrmm.  It appears that some bright white light is firing every time something using a light fires; it's a bright white light. 

It's definitely the lighting system, not the bloom / distortion (which works better here, btw), I just disabled both.

Were you creating a StandardLight to test alignment all the time and forgot to remove it from the build, maybe?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.23) (Bloom! Fixes!)
Post by: Dark.Revenant on May 23, 2014, 07:51:28 PM
Try this:

ShaderLib Alpha v1.23
Download Alpha v1.23 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.23.zip)
(MediaFire Mirror) (https://www.mediafire.com/?dwbhun68ccc8lrp)

Alpha v1.23 (May 23, 2014)
- Restructured internal rendering code
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.23) (Bloom! Fixes!)
Post by: xenoargh on May 23, 2014, 07:58:45 PM
<tests>

Yay, that got it :)

Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.23) (Bloom! Fixes!)
Post by: DeathRay on May 24, 2014, 08:11:31 AM
Is it normal that the Bloom is very GPU intensive or am I doing something wrong?

I have a GTX 670 and when the Bloom is enabled, my frames are often dropping down to 30, even in a two frigate fight.

After disabling the Bloom I can play at 60 fps with no problems.

All other configurations are standard.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.23) (Bloom! Fixes!)
Post by: Sabaton on May 24, 2014, 11:41:58 AM
You're not the only one with problems, every time something hits the shields and causes that ripple effect my FPS drop like a stone. :(
And I don't have a bad PC either.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.23) (Bloom! Fixes!)
Post by: Dark.Revenant on May 24, 2014, 12:59:00 PM
Bloom is fairly GPU intensive but shouldn't be causing a frame rate hit on your card.  And distortions are less intensive than lights, by far.

Sebaton, try setting "use64BitBuffer" to false and see if that improves your frame rate.

DeathRay, try disabling vsync.  It can cause you to drop from 59 fps to 30fps.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.23) (Bloom! Fixes!)
Post by: DeathRay on May 24, 2014, 04:09:50 PM
Thanks, that seems to have solved the problem.
Didn't even know that this Option existed. o.O
Maybe something that should be put in an option Menu.
Or am I just blind and didn't saw it there?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.23) (Bloom! Fixes!)
Post by: Sabaton on May 24, 2014, 05:16:17 PM
try setting "use64BitBuffer" to false and see if that improves your frame rate.

 That hit the spot. Thanks a lot!
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.23) (Bloom! Fixes!)
Post by: xenoargh on May 24, 2014, 07:57:33 PM
Minor thing caught in Vacuum thread: http://fractalsoftworks.com/forum/index.php?topic=4292.msg135072#msg135072

Oh, and I'll try out the 64-bit thing; haven't really had major performance issues but if it doesn't change the appearance much, it's probably the good default to use rather than the more-aggressive setting :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.23) (Bloom! Fixes!)
Post by: Dark.Revenant on May 24, 2014, 08:11:41 PM
It reduces aliasing on scenes with multiple distortions of varying size/shape/intensity.  Something you won't notice unless it's working improperly.  I went and redid the whole upload just to set the default to false, though, because ShaderLib has to work perfectly for everybody, no exceptions.

ShaderLib Alpha v1.24
Download Alpha v1.24 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.24.zip)
(MediaFire Mirror) (https://www.mediafire.com/?dsd4zjsdqk754bd)

Alpha v1.24 (May 24, 2014)
- Added an alternative low-memory animated ripple
- Decreased graphics memory usage, especially when shaders are disabled
- Fixed file naming standards
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.23) (Bloom! Fixes!)
Post by: xenoargh on May 24, 2014, 08:27:31 PM
I hear you on that.  It's always better to have the fancy stuff for power-users to tweak; the defaults should be safe, even if safe isn't perfectly pretty. 

99% of users won't really notice most of the high-end stuff anyhow; I saw very little observable difference in the bloom settings during practical playtesting, for example; the differences were subtle enough that they were only really observable if I compared screenshots :)

A quick thought.  It'd be fairly easy to write a Dialog system to turn options on / off with in-game, if ShaderLib could handle it from an internal perspective. 

I've been thinking about writing up such a thing for Vacuum, the only thing that stops me is dealing with language support issues on non-QWERTY keyboards.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.24) (Bloom! Fixes!)
Post by: Dark.Revenant on May 24, 2014, 08:43:38 PM
Most of the settings require initialization, in some cases major initialization.  Texture initialization stuff like bloom mips are possible to reinitialize between combat but things like enabling/disabling distortions are far more difficult to change without a restart.

The problem with custom dialogs for this is we basically have to make the entire functionality from scratch.  And it would only work from mid-campaign.  I'd rather have this stuff in the options menu.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.24) (Bloom! Fixes!)
Post by: Dark.Revenant on May 26, 2014, 05:58:11 PM
(http://i.imgur.com/7bDlvVe.png)

Older Examples:
Spoiler
(http://i.imgur.com/tuctpoD.png)
(http://i.imgur.com/YAYIjx7.png)
(http://i.imgur.com/zVhWIj1.png)
[close]

ShaderLib Alpha v1.3
Download Alpha v1.3 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.3.zip)
(MediaFire Mirror) (https://www.mediafire.com/?lk00f9dtdo9f9n5)

Alpha v1.3 (May 26, 2014)
- Blinn-Phong lighting added to Lighting Engine for cases where a sprite uses a normal map (this feature is off by default and is intended for TC mods and a possible future where more sprites have normal maps)
- Added "enableNormal", "specularIntensity", "specularHardness", and "lightDepth" options to settings.json
- Rare NVIDIA fullscreen "ghosting" issue resolved
- Light data documentation added (in the data/lights folder)
- Custom material maps supported (to use, link a texture to the ship/weapon by adding a key to "graphics" in data/config/settings.json; see example in ShaderLib)
- Custom normal maps supported (to use, link a texture to the ship/weapon by adding a key to "graphics" in data/config/settings.json; see example in ShaderLib)
- Example normal and material maps added for Conquest, Onslaught, and Paragon (the normal maps were machine-generated)



This update adds support for Material Maps and Normal Maps for ship and weapon sprites.

Material Map: This texture determines the reflectivity of the sprite.  Internally, the lighting engine uses a minimum function (i.e. reflectivity = the darker of the pixel on screen and the corresponding pixel on the material map), so there are limitations on what you can do with a material map.  In general, you want to begin with the original ship sprite and then darken areas that should not reflect as much light.  You can also darken individual color channels to allow interesting effects like having reflected shines being a different color than the hull.  Also, the material map influences specularity if you are using normal maps; a brighter material will have a brighter shine.  Remember that the material map must have an alpha channel that matches the original sprite's alpha channel.  To link a material map to a ship/weapon, add a key under the "shipMaterial" or "weaponMaterial" category in the "graphics" section of data/config/settings.json.  The key name must match the id of the ship/weapon you are adding the material map for, appended with "_hardpoint" or "_turret".  Individual frames for animated weapons should be named as such: "weaponId_turret0", "weaponId_turret1", "weaponId_turret2", etc.  See the example in ShaderLib.  If a sprite lacks a material map, the default is the original sprite (i.e. identical to previous lighting versions).

Normal Map: This texture is difficult to make and is NOT RECOMMENDED FOR MOST MODS.  The effect gained by using normal maps is subtle and is typically a very large amount of work for a small amount of gain.  There are many tutorials for making normal maps elsewhere on the Internet, if you are interested in making them for vanilla sprites or your own ships.  Remember that the normal map must have an alpha channel that matches the original sprite's alpha channel.  To link a normal map to a ship/weapon, add a key under the "shipNormal" or "weaponNormal" category in the "graphics" section of data/config/settings.json.  The key name must match the id of the ship/weapon you are adding the normal map for, appended with "_hardpoint" or "_turret".  Individual frames for animated weapons should be named as such: "weaponId_turret0", "weaponId_turret1", "weaponId_turret2", etc.  See the example in ShaderLib.  If a sprite lacks a normal map, the lighting engine will default to using the old lighting model for that sprite rather than the new Blinn-Phong model.



Normal maps are NOT RECOMMENDED.  They are intended for total conversions and special occasions.  Make normal maps AT YOUR OWN RISK!

Normal maps are very time-consuming to make and they should absolutely NOT become the norm for Starsector mods.  ShaderLib is meant to enhance the user experience, not force modders to do significantly more work.  As such, normal maps are disabled by default and must be manually enabled in ShaderLib's settings.json.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.3)
Post by: xenoargh on May 26, 2014, 08:50:44 PM
Wow, I am impressed; I thought that was going to have to wait for Alex to make it a little easier :) 

On normal maps... only one major question atm; how is the Sun (main light source) defined?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.3)
Post by: Dark.Revenant on May 26, 2014, 08:54:53 PM
It's not.  The main light is built-in to the sprite.  Normals only affect point and line light calculations.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.3)
Post by: xenoargh on May 26, 2014, 09:00:55 PM
Ah.  So we just need to add a sun light vector to the shader then, if we want a non-overhead light source to do the major lighting, like in the WTF example. 

Are the material maps handled in the same shader? 

I apologize for asking stupid questions- I'll look at this later on and see what makes sense to mess with; I probably won't do anything serious with this, but I'm interested in messing with it for the fun of it and will probably want to do shader variants :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.3)
Post by: Dark.Revenant on May 26, 2014, 09:39:57 PM
Correct.  I'll be adding two more light types in the next update (directional and conical) which will make that easier.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.3)
Post by: kazi on May 27, 2014, 01:08:32 AM
Normal maps are NOT RECOMMENDED.  They are intended for total conversions and special occasions.  Make normal maps AT YOUR OWN RISK!

Normal maps are very time-consuming to make and they should absolutely NOT become the norm for Starsector mods.  ShaderLib is meant to enhance the user experience, not force modders to do significantly more work.  As such, normal maps are disabled by default and must be manually enabled in ShaderLib's settings.json.

eheheheh.
(http://i.imgur.com/am1Nt84.gif)

Some broken bits (blender is dumb sometimes), but should be pretty easy to fix. For once I'm not kicking myself over using 3D models.

*edit- fixed the broken bits. Sometimes blender thinks things are "inside-out" when they're not. But yeah, great job on the normal map functions. Just have to start adding these in-game now ^^
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.4)
Post by: Dark.Revenant on May 27, 2014, 04:33:29 AM
Yet another update.  There were quite a few problems with the previous version, so if something looked wonky this will definitely have fixed it.

ShaderLib Alpha v1.4
Download Alpha v1.4 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.4.zip)
(MediaFire Mirror) (https://www.mediafire.com/?tj9rdg8ji4j108k)

Alpha v1.4 (May 27, 2014)
- Fixed normal rotation and direction issues
- Added support for cone-type and directional-type lights
- Added "normalFlatness" option to settings.json
- Removed unnecessary setter methods from LightAPI
- Maximum lights reduced to 372
- Material-mapped hulks now have much less specularity and reflectivity
- Added methods to LightAPI: float getArcStart(), float getArcEnd(), Vector3f getDirection(), float getSpecularIntensity(), float getHeight()
- Added methods to StandardLight: void setArc(float start, float end), void setDirection(Vector3f direction), void setSpecularIntensity(float intensity), void setHeight(float height)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.3)
Post by: xenoargh on May 27, 2014, 11:58:30 AM
Kazi, heh indeed, can't wait to see the results :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: Dark.Revenant on May 31, 2014, 09:50:35 PM
Major update!  No new features so it's not 1.5 yet, but there have been many fixes and now every vanilla weapon and ship has a material map and a normal map.  The normal maps were generated through CrazyBump but are perfectly serviceable.

Screenshots
Spoiler
(http://i.imgur.com/SbXGy2J.png) (http://i.imgur.com/bpgS9tA.png)

(http://i.imgur.com/TEwoZki.png) (http://i.imgur.com/jE7vhKh.png)

(http://i.imgur.com/rjFh3bc.png)

(http://i.imgur.com/f0XcAg4.png)

(http://i.imgur.com/a7dH9ax.png)

(http://i.imgur.com/4oFuZRa.png)

(http://i.imgur.com/AMB9iYB.png) (http://i.imgur.com/YwlXL0D.png)

(http://i.imgur.com/4ALyPAh.png)

(http://i.imgur.com/nSJ9fqf.png)
[close]

ShaderLib Alpha v1.45

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.45 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.45.zip)
(MediaFire Mirror) (https://www.mediafire.com/?c50dcdmia19ntv7)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.45 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.45.zip)
(MediaFire Mirror) (https://www.mediafire.com/?j7iv0iwxmu32xfb)


Alpha v1.45 (May 31, 2014)
- Added material maps and normal maps for all vanilla ships and weapons
- Fixed weapon material and normal maps (you can now specify whether it is the hardpoint or turret)
- Minor viewport fixes that may improve compatability with other mods that use OpenGL
- Fixed screen scaling issue in windowed mode when the window resolution is equal to the desktop resolution
- Fixed specularity direction error on point, line, and cone lights
- Lights no longer reflect on phased ships
- Re-adjusted default settings
- Split ShaderLib into two distributions: Basic and Full
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: Dark.Revenant on May 31, 2014, 10:03:44 PM
People have asked me whether the material maps and normal maps make a difference.  Decide for yourself:

Spoiler
No Material, No Normal (Except the weapons which still have material maps because it is not trivial to remove them)
(http://www.sc2mafia.com/Starsector/NoMaps.png)

Has Material, No Normal
(http://www.sc2mafia.com/Starsector/Material.png)

Has Material, Has Normal
(http://www.sc2mafia.com/Starsector/MaterialNormal.png)
[close]
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: xenoargh on June 01, 2014, 02:07:37 PM
Not seeing huge differences there.  You really should add a distant light source and offlight shading, so that there's a clearly-defined lit / shadowed side to forms.  That, and use an example that was built professionally- ask Kazi if he's got anything ready, perhaps- I won't have time to look at this in a serious way for a week or so, due to all the other stuff on my plate atm :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: Dark.Revenant on June 01, 2014, 03:13:39 PM
I am going for compatibility.  Adding a directional light makes the difference between normal-mapped ships too obvious, which is not good for mods involving lots of ships that lack normal maps.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: xenoargh on June 01, 2014, 03:39:49 PM
If it's done right, with proper normalmaps and a fixed main light / ambient and a material pass that includes self-illum, AO and metallicity in the second texture (I think that metallicity would generally work better than straight shininess, especially if it handled blinn well), the difference will be big and obvious, and that's kind of the point of such a radical departure from the SS rendering core's aesthetic :) 

I think that the issue is one of largely chicken-and-egg at this point; until there's content made specifically for this, there is no point; but the tech needs some content to develop with and get polished.  If Kazi or the other folks around here with the relevant expertise don't beat me to it, I will try and make that happen as soon as I'm done on the current build of Vacuum, as I'd like to see it- not sure I'd ever have time to do a whole project with it, but a demo, sure. 

This caught me at a bad time, unfortunately, in terms of availability, otherwise I'd have knocked together something already :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: Dark.Revenant on June 01, 2014, 04:30:59 PM
We already have AO and self-illumination because of the existing sprites.  No point making redundant sprites for that.

If you mean specularity with metallicity, then I can make a pass for that kind of map.  Actual metallicity (microfilaments) would require the shader to be made far more complex than it already is.

Also, shading looks very odd with this system because it is a post process effect.  The only way to have "shading" is to have the base be darker by default, which limits color range.  At best, I'd say you can have the shadows be about 25% darker than the base sprite without losing too much color.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: xenoargh on June 01, 2014, 05:09:53 PM
No, I mean AO, as in a grayscale value that would tone down all specular results from the diffuse + specular + normalmap, and self-illum, as in stuff that is lit even on the dark side.

So, basically (for the material map):

R channel = self-illum, if > 0, then final result = lerp(diffuse, final after normalmap, spec, blah, self-illum value).  A value of 1.0 means that the texel should just equal the diffuse value, so go ahead and halt, if that is cheaper than the branch.

G channel = metallicity (blinn controller ++ factor in base diffuse RGB into final blinn values for a colored-diffraction metal look on blinn highlights if <some boolean uniform> set).  

IOW, use that distant light to push up values in shiny areas with blinn highlights where it makes sense, allow for non-shiny areas (for different material feels, metal vs. plastic vs. rubber and so forth).  Values above 0 get some blinn, 0 value gets normals lit but no blinn and no color range tweaking.

B channel = AO (if value < 1, push final values towards diffuses * ambient via lerp).  Would help preserve height values properly by faking true shadows a bit.  Very important for a professional feel on this stuff; normal lighting / blinn alone doesn't quite cut it.



That is more-or-less how I think it should work, for the material map; that means each ship / weapon / missile uses only 3 textures per pass, which isn't too scary, texture-memory-wise.

Anyhow, that is roughly what I want to do with this.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: Dark.Revenant on June 01, 2014, 05:58:33 PM
You can already simulate self-illumination by making it a bright spot on the texture but a darker spot on the material map.  You can simulate AO by making a spot darker on the material map (mathematically, there is no difference; a value of 0 on the material map causes the pixel to never be light by lights).  And you get the metallicity color diffraction and specular multiplier through the material map via the material map's color and total luminosity at a given pixel, respectively.  The only thing you can't do is get the Blinn-Phong hardness through material, but this is a small price to pay.

By the way, you can't pass in a boolean uniform per ship because it's a full-screen shader.

If you want to make a TC with this kind of lighting model, you should be able to do it without any code changes, just by replacing the shader files.  However, I will never be using such a high-maintenance model for the vanilla release because it causes material maps to be far more difficult to make and also puts more strain on the modder to create these effects due to the greater perceived difference.  The lighting is deliberately muted specifically so that modders are not forced to make a bunch of assets that they weren't anticipating.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: xenoargh on June 01, 2014, 07:06:19 PM
Don't worry about it.  Until there's something actually done, it's pretty needless to speculate about it all, tbh; I want to get it to the tech-demo stage and then we'll all have something to talk about :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: DornoDiosMio on June 06, 2014, 11:46:01 PM
Is it just me or does this version use the CPU more heavily than the one I downloaded approximately two weeks ago?  I looked through the settings file, but, did not notice any options which were notated as being CPU intensive.

My GPU is a GTX 460 and it never goes above 50% usage in large battles while using this mod, but, I still get FPS drops.  They are especially common right at the start of a new battle with a good number of ships. It happens at other times as well, but, seems to always be reproducible at the start of a new battle. Sometimes everything is fine after 10-15 seconds, other times it comes back randomly.

I did notice one of the CPU cores was maxed out at 100% and another was rather close to max.  I'm running a Phenom II x4 @ 3.5ghz with 4GB 1333mhz ram.  So, not exactly the newest setup, but, it is good enough that I can put off buying a new computer until I have the money to pay for one, lol.

Mainly just wondering if the heavy CPU usage is normal and if there is anything I can potentially adjust to gain the wee bit of performance I need to avoid FPS drops.  Setting normal maps to false seemed to resolve the issue in some brief testing, but, not entirely.  With normal maps disabled I still had the issue despite the battle being devoid of any vanilla ships. So, I thought that was odd and it is primarily what led me to ask you about the issue.

Anyways, I love the mod and the work you have done on it! Well done my good man!

Note: All settings are at default values with the exception of Normal maps being set to false.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: Dark.Revenant on June 07, 2014, 06:51:05 AM
Indeed, it does use more CPU because of the try-catch logic required for the makeshift texture loader to work (the alternative is forcing modders to keep extensive data tables for normals and materials) but it shouldn't be using *that* much more CPU.  I just did a profile on my ship-spam arcade mode and all the shaders together used about 7 seconds of CPU time over the course of a 6+ minute run, indicating that about 2% of my i5 2500K core was being used by shaders.  Starsector does not use multicore processing, by the way.

What could really be happening is a texture loading issue, since I believe all Starsector textures are held in RAM even if the GPU loads it, to make sure loading times are short.  Material and normal maps do constitute a non-trivial amount of memory used; for example, with the mods I have enabled (including multiple factions plus vanilla all using normals/materials), Starsector uses 559 MB of texture data, approaching triple that of vanilla.  You only have 4GB of RAM so it could be slowdowns due to your operating system automatically using your swap space rather than RAM for texture loading.  This isn't counting the texture buffers I use for shaders, which can run another 200 MB in some situations, since that is only for GPU memory (they are not reflected in RAM).
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: Alex on June 07, 2014, 11:38:49 AM
What could really be happening is a texture loading issue, since I believe all Starsector textures are held in RAM even if the GPU loads it, to make sure loading times are short.

This isn't the case. The loading times are short because the game loads all the textures into video memory, and they stay there, so there's almost no loading after the initial load :) (Background textures are an exception, but these get re-loaded from disk, and aren't kept in RAM either.)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: DornoDiosMio on June 07, 2014, 02:10:04 PM
I think I was right on the edge of being able to play with a solid 50fps frame rate prior to the update of shaderlib and just that little bit of extra CPU usage causes some drops down below 50fps.

I'm running @ 50fps because 60fps used to give occasional slowdowns using the old version of Shaderlib, so playing at 50 fps allowed me to reduce the workload a decent bit and maintain a smooth constant frame rate.

Playing with normal maps I get some pretty frequent drops down below 50 fps. Playing without normal maps I see fps drops on rare occasions, but, it is not frequent enough to be a concern.

Also my compy must be doing some sort of auto load balancing as Starsector uses all 4 cores while I'm playing the game.  At one particular point it was using 313% out of 400% across all 4 cores.  When I stop the game CPU use drops down to nothing.  I'm pretty obsessive about not running any background processes or services on my computer. I am using the 64-bit version of the Java runtime with 1024/2048 memory settings.

One last thing, physical memory usage is only about 2.5GB while playing the game so that seems OK.  Gfx card memory usage maxes out @ 600MB w/o Uomos Corvuz and about 800MB with.

So yeah, I think everything is fine and the new version was just enough to cause a noticeable difference. I turned on triple buffering so that should make the fps drops less noticeable.

Just in case you want to see it, here is a picture from Afterburner of my CPU cores during a SS mission.  This was only about 2-3 minutes of game play and I cleared the graph right before launching the game.

(http://s29.postimg.org/e6n3tmq2b/Untitled.jpg) (http://postimg.org/image/e6n3tmq2b/full/)

So let me know if anything seems out of place and thank you for your time.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: Dark.Revenant on June 07, 2014, 02:22:12 PM
Well, lighting does require all the ship sprites to be redrawn, and using normal maps causes all the ship sprites to be redrawn twice in total (except with different textures, of course).  That could be the main CPU usage issue for you, since the ship drawing function is rather expensive.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.45) (Normal Maps!)
Post by: DornoDiosMio on June 08, 2014, 04:13:47 PM
Well, lighting does require all the ship sprites to be redrawn, and using normal maps causes all the ship sprites to be redrawn twice in total (except with different textures, of course).  That could be the main CPU usage issue for you, since the ship drawing function is rather expensive.

Yes that makes sense as it appears I was on the edge performance wise anyway.  Everything is working well now though as long as I disable normal maps and run at 50hz monitor resolution I very rarely get FPS drops and on the rare occasion it does happen I barely notice.

It also only seems to happen when there are a lot of ships on the map and even then it is pretty rare. It is possible that it may have been the same with the older version of shaderlib as well, but, I just didn't notice it as I was not yet into the later parts of the game where you have tons of ships at once. So, thanks a lot for the help!

Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.5)
Post by: Dark.Revenant on June 08, 2014, 11:25:03 PM
See if this update helps your performance.  It should be significantly faster.

The way that materials and normals are defined is now totally different.  The method is similar to how lights are defined; you use a csv database, which points to textures you define in settings.json.  See data/lights/core_texture_data.csv for an example.

ShaderLib Alpha v1.5

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.5 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.5.zip)
(MediaFire Mirror) (https://www.mediafire.com/?umgo06nkoza1e88)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.5 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.5.zip)
(MediaFire Mirror) (https://www.mediafire.com/?ume8hdjktne81gm)

Alpha v1.5 (June 9, 2014)
- Added texture loader tables; you will need to define your material and normal maps in a csv
- TextureEntry and TextureData added
- Fixed quality-5 bloom causing bloom to disappear
- Significant CPU performance increase with lighting and normal maps
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.5)
Post by: DornoDiosMio on June 11, 2014, 04:58:16 PM
Thanks, I'll check it out and let you know how it goes asap!
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.51)
Post by: Dark.Revenant on June 11, 2014, 06:26:18 PM
Small update, only really relevant for people who use ShaderLib Basic.

ShaderLib Alpha v1.51

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.51 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.51.zip)
(MediaFire Mirror) (https://www.mediafire.com/?on6eb138x0qbcbr)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.51 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.51.zip)
(MediaFire Mirror) (https://www.mediafire.com/?h1s405nq45w3cjj)

Alpha v1.51 (June 11, 2014)
- Added missile material and normal map support, plus vanilla missile material and normal maps (these will not do anything until the next Starsector update)
- Fixed crash for ShaderLib Basic
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.51)
Post by: Rambobrill on June 12, 2014, 12:21:04 PM
hi there. i tried to use ShaderLib with Exerelin but it didnt work. no distortion on shield or at explosions and no lightning effect after the white flash of the bigger ships. and improvement overall. so i wanted to ask if it is possible to get it to work with exerelin. at least the newer explosion effects?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.51)
Post by: doodeeda on June 12, 2014, 06:02:29 PM
Hello, I tried out the Vacuum mod, but I found it very hard to play as I experienced low fps whenever I tried to move my ship or fire my weapons due to the thrusters or beams, etc. The creator of the mod advised me to just disable shaders for now, and he also wanted me to explain the problem in this thread also.

My graphics card: ATI Radeon HD 4300/4500 Series
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.51)
Post by: Dark.Revenant on June 12, 2014, 07:46:46 PM
hi there. i tried to use ShaderLib with Exerelin but it didnt work. no distortion on shield or at explosions and no lightning effect after the white flash of the bigger ships. and improvement overall. so i wanted to ask if it is possible to get it to work with exerelin. at least the newer explosion effects?
All of those things are Starsector+ features, for various reasons.  The only thing that ShaderLib does by default is the weapon lighting, which you should be noticing on at least the vanilla weapons in Exerelin.  If you want those things in Exerelin you should just ask Zaphide to port them over; he's welcome to use my code.

Hello, I tried out the Vacuum mod, but I found it very hard to play as I experienced low fps whenever I tried to move my ship or fire my weapons due to the thrusters or beams, etc. The creator of the mod advised me to just disable shaders for now, and he also wanted me to explain the problem in this thread also.

My graphics card: ATI Radeon HD 4300/4500 Series
Shaders don't actually get used when ships are thrusting, unless xenoargh added something that does that.  Have you tried lowering the settings options (in the settings.json in the root directory of Vacuum)?  Your graphics card is rather old and underpowered but should be enough to at least run the basic lighting.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.51)
Post by: doodeeda on June 12, 2014, 08:00:06 PM
The side thrusters were particularly hard on the system. Once I disabled shaders under 'Global Options', it fixed all my problems. I shall try enabling shaders under 'Global Options' but disabling some other effects under 'Light/Distortion Options' to find a good balance. Thanks for the help!
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.51)
Post by: xenoargh on June 12, 2014, 09:22:58 PM
Quote
Shaders don't actually get used when ships are thrusting, unless xenoargh added something that does that.  Have you tried lowering the settings options (in the settings.json in the root directory of Vacuum)?  Your graphics card is rather old and underpowered but should be enough to at least run the basic lighting.
I have a "vernier thruster" system in Vacuum, where it looks like little jets that turn on when the ship's turning or strafing, and it now uses ShaderLib lights to accentuate the look, which looks great (I only have them on Frigate+ size hulls, so it is comparatively cheap).
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.51)
Post by: DornoDiosMio on June 12, 2014, 11:55:58 PM
The 1.5 version made a significant difference in the performance of Starsector on my system.  Even with everything turned on I don't experience any loss of FPS.

So I'm having quite a bit of fun with it! Thanks!
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.51)
Post by: xenoargh on June 13, 2014, 11:50:50 AM
Cool!  I'll upgrade to 1.5 internally for Vacuum for the next build, then.  Was holding off until I was pretty sure it was stable :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.51)
Post by: NCMagic on June 16, 2014, 12:07:38 PM
Apparently this happens with shaderlib 1.51 (basic):
23862 [Thread-5] ERROR com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - java.lang.RuntimeException: Error loading [graphics/shaders/material/asteroids/asteroid2_material.png] resource, not found in [C:\Users\Nico\Desktop\Starsector\starsector-core\..\mods\ShaderLib Basic,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/shaders/material/asteroids/asteroid2_material.png] resource, not found in [C:\Users\Nico\Desktop\Starsector\starsector-core\..\mods\ShaderLib Basic,../starfarer.res/res,CLASSPATH]
   at com.fs.util.C.Ó00000(Unknown Source)
   at com.fs.util.C.Ó00000(Unknown Source)
   at com.fs.graphics.TextureLoader.Ò00000(Unknown Source)
   at com.fs.graphics.TextureLoader.o00000(Unknown Source)
   at com.fs.graphics.TextureLoader.o00000(Unknown Source)
   at com.fs.graphics.TextureLoader.o00000(Unknown Source)
   at com.fs.graphics.H.super(Unknown Source)
   at com.fs.starfarer.loading.OooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
   at com.fs.oOOO.A.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

(This happens with every mod, and when just starting starsector with this mod.)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Dark.Revenant on June 16, 2014, 06:49:29 PM
Sigh, one of the reasons I wish there was a proper texture loader.  Small update:

ShaderLib Alpha v1.52

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.52 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.52.zip)
(MediaFire Mirror) (https://www.mediafire.com/?21eam8y023ax225)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.52 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.52.zip)
(MediaFire Mirror) (https://www.mediafire.com/?tbzmirenr9w3ne0)

Alpha v1.52 (June 16, 2014)
- Added "weaponFlashHeight" and "weaponLightHeight" options to settings.json
- Fixed ShaderLib Basic again
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Arakash on June 19, 2014, 10:58:02 AM
I was just directed to post in this thread from the Vacuum mod thread (http://fractalsoftworks.com/forum/index.php?topic=4292.msg136703#msg136703) by a user called xenoargh (http://fractalsoftworks.com/forum/index.php?action=profile;u=2228)

He wanted me to mention a graphics card i was using when i was having a technical issue with the mod that turned out to be shader related. It was causing very very low FPS.
In the case of that problem, it was fixed by turning the shaders off in the mod settings.

The card i was (and am) using a NVIDIA GeForce GTX 260, which is 4-5 years old atm according to the website.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Dark.Revenant on June 19, 2014, 06:08:32 PM
Your card is more than enough.  First of all, I'd like you to revert settings.json (the one that ShaderLib uses) to the default and post the contents of that here.  After doing that, try setting "use64BitBuffer" to false if it is true by default (which it shouldn't be, since I set that to default off weeks ago) and see if that improves your performance.

Are you using SLI when playing Starsector?  If so, does disabling SLI improve your performance?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: xenoargh on June 19, 2014, 06:37:05 PM
I'm shipping it with the stock ShaderLib config, btw, other than not having any normal / material maps defined, since I'm not using that.  I'm not bothering to try optimizing it any yet for the specifics of Vacuum's speed requirements, as it's barely using more CPU than Combat Radar is, c. 6-7% during max. loads.  So whatever the settings were in 1.51 is what was there.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Dark.Revenant on June 19, 2014, 06:59:21 PM
I see, that's good to know.

Arakash, what CPU are you using?

In the Vacuum thread, you claimed that the framerate is fine while the game is paused.  Shaders, however, are still active while paused (or in the tactical map).  The only difference is a CPU usage spike between paused and not-paused.  I believe that the full difference is about a 5-10% increase in CPU usage in an unpaused game by having ShaderLib on, depending on situations.  It could be possible that Vacuum is doing things with lights that are more CPU-intensive than intended.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: xenoargh on June 19, 2014, 11:19:35 PM
I doubt it, but you're perfectly welcome to profile it by simply installing the mod and running the only Mission available, which is a giant fleet-on-fleet battle where you'll see maximum loads :)

The worst abuse of lights is the lights on the various thrusters, particularly fighters' engines; but here, at least, it's a negligible increase in load, when profiled; removing it speeds things up by less than 1% in max-load situations.  I deliberately don't use a lot of lights on shots, shot-hit and firing light TTLs are very short, and beam lights are all capped at a TTL of 0.1 seconds to keep loads reasonable while fading somewhat gracefully, and generally, only large beams get beam lights, since that's a known concern.

So I doubt if that's it, tbh; the caps on total lights and the requirements to replace lights in terms of priority should be sufficient.  I intend to replace the flare-lights on the fighters with perma-lights that are attached to the entities eventually, rather than new lighting events, and then manage them, but based on what you've said about the system, it's unclear to me how much, if any, CPU savings would be realized, so it's been a fairly low priority until I'm done with the next big build and have cleared my plate to play much more seriously with all things shader-related :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Arakash on June 20, 2014, 02:02:33 AM
Sorry i didnt get back to you more quickly.
Ill try and answer all the questions asked that weren't already addressed by xenoargh.

My CPU is an i7 ~2.8ghz with 8 cores.

Ill try to be specific when i describe the issue, so its clear.
Its caused when i view any bullets of all types, enemy or my own, including missiles beams etc on the normal viewing screen.
I can view the game running with weapons fire in the tactical map, but as soon as i switch back to viewing/controlling directly and weapons fire is on screen, same problem.
It only took 1 bullet/missile/laser on screen to make it about 1-5fps at which point i basically have to end the process manually because i couldn't exit. (5fps is probably generous, i think its closer to 0.25-1fps, basically a slideshow)

I am in fact using SLI.
I tried disabling it, no change as far as i can tell.

I can confirm use64bitbuffer is false in my settings.


Edit:
A couple ways of fixing it i have found so far in the settings.json file.
Turning sharers off completely OR

Setting enableBloom to false. OR
(changing bloomquality and bloommips alone according to instructions in the file doesnt improve the situation)

Setting enableLights to false.
(halving the number of maximumLights worked when i was firing a pulse weapon until a beam was fired, then slideshow again)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Dark.Revenant on June 20, 2014, 02:37:35 AM
It could be an issue of having too much video memory allocated for your 1GB to handle (you don't add two cards' memory space together when they're in SLI).  Bloom uses somewhere around 150MB of video memory in total, iirc.  If Vacuum is using a large amount of memory for textures, this could be causing your problem.

Open up starsector.log and find the most recent line that looks something like:
Quote
121380 [Thread-5] DEBUG com.fs.graphics.TextureLoader  - Loaded 566.77 MB of texture data so far
(This is with all the SS+ factions, using dev versions that include extra materials/normals.)

Depending on how large this value is, it could simply mean that too many textures are loaded by the game.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Arakash on June 20, 2014, 02:51:04 AM
It could be an issue of having too much video memory allocated for your 1GB to handle (you don't add two cards' memory space together when they're in SLI).  Bloom uses somewhere around 150MB of video memory in total, iirc.  If Vacuum is using a large amount of memory for textures, this could be causing your problem.

Open up starsector.log and find the most recent line that looks something like:
Quote
121380 [Thread-5] DEBUG com.fs.graphics.TextureLoader  - Loaded 566.77 MB of texture data so far
(This is with all the SS+ factions, using dev versions that include extra materials/normals.)

Depending on how large this value is, it could simply mean that too many textures are loaded by the game.

I had a look, but ill be honest i really dont understand what im looking at. For example i thought the number on the left would be a chronological number, but some of them seem out of order.
The largest numbers i could find in the format you quoted were around 300-400mb.

Ive attached 115kb of the last of the log in a text file to this post, just so you can check i am reading it correctly.


[attachment deleted by admin]
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Dark.Revenant on June 20, 2014, 03:13:39 AM
That is extremely bizarre, and if left unfixed I may have to call it quits on the project.  Your hardware is essentially the performance target; I have designed it to run at its fullest on an i5 CPU with a GTX 260 /w 1GB.

Do you get the same issue in other mods?  Try ShaderLib 1.52 alone with vanilla Starsector and see if the poor performance continues.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Arakash on June 20, 2014, 03:36:06 AM
That is extremely bizarre, and if left unfixed I may have to call it quits on the project.  Your hardware is essentially the performance target; I have designed it to run at its fullest on an i5 CPU with a GTX 260 /w 1GB.

Do you get the same issue in other mods?  Try ShaderLib 1.52 alone with vanilla Starsector and see if the poor performance continues.
I just tried a mission with Vanilla and ShaderLib 1.52.
I didn't see the same problem i was reporting or any drop in fps as far as i could tell.

Edit: I also just tested Uomoz's Sector with ShaderLib, no issues there either.

Vacuum specific problem i guess?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Dark.Revenant on June 20, 2014, 03:44:07 AM
Yes, it seems that way.  I know that xeno made some changes to the shader code in his mod, so it is most likely something that he has done at some juncture.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: xenoargh on June 20, 2014, 03:03:31 PM
No, I haven't changed anything at all.  We're talking about a stock 1.51 here.  If 1.52 resolved it, then most likely it was the same issue reported for 1.51 and it'll be resolved when I update the build, hopefully this evening :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: NCMagic on June 23, 2014, 03:05:36 AM
After seeing a fancy way of showing errors and stuff, I'm not sure if the way I'm using is correct.
Oh well.
31329 [Thread-5] ERROR com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - java.lang.RuntimeException: java.lang.ArithmeticException: / by zero
java.lang.RuntimeException: java.lang.ArithmeticException: / by zero
   at sound.Sound.<init>(Unknown Source)
   at com.fs.starfarer.loading.OooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
   at com.fs.oOOO.A.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArithmeticException: / by zero
   at sound.super.<init>(Unknown Source)
   at sound.B.super(Unknown Source)
   ... 6 more

Apparently it divided by zero, I'm not sure how, but this happened when I was trying to run starsector+ with lazylib and shaderlib.
Edit: I need to add that I changed vmparams to 1024 1024 and this happened. This happened before when I turned bloom off with 512 1024 .
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Dark.Revenant on June 23, 2014, 08:04:39 AM
After seeing a fancy way of showing errors and stuff, I'm not sure if the way I'm using is correct.
Oh well.
31329 [Thread-5] ERROR com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - java.lang.RuntimeException: java.lang.ArithmeticException: / by zero
java.lang.RuntimeException: java.lang.ArithmeticException: / by zero
   at sound.Sound.<init>(Unknown Source)
   at com.fs.starfarer.loading.OooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
   at com.fs.oOOO.A.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArithmeticException: / by zero
   at sound.super.<init>(Unknown Source)
   at sound.B.super(Unknown Source)
   ... 6 more

Apparently it divided by zero, I'm not sure how, but this happened when I was trying to run starsector+ with lazylib and shaderlib.
Edit: I need to add that I changed vmparams to 1024 1024 and this happened. This happened before when I turned bloom off with 512 1024 .

It is essentially impossible for me to find where this error could possibly be coming from unless you give me more information.  When did this error happen?  What are your system specs?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: NCMagic on June 23, 2014, 01:12:01 PM
It happened when I was starting starsector up, then it just crashed, a while later it stopped working and I had to reinstall to make it work again.
My cpu is intel B815 6ghz (can't see it very well on the laptop).
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Dark.Revenant on June 23, 2014, 02:35:46 PM
Oh, I see your problem.  Your hardware is incompatible because you're from the future, where they can overclock 1.6 GHz CPUs by a factor of 4.

In all seriousness, to get your actual system specs, type 'dxdiag' into start and copy down what it says for your CPU, RAM, and display card.


However, I did some research and found that the Intel Celeron B815 is astonishingly low-spec and uses Intel HD 2000-level graphics, which is below the minimum specs for ShaderLib's lighting and distortion engines (the minimum is Intel HD Graphics 3000).  As a result, you are recommended to have ShaderLib disabled from settings.json, at all times.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: NCMagic on June 23, 2014, 10:45:48 PM
I'm just going to qoute it from the program:
CPU: Intel(R) Celeron(R) CPU B815 @1.60GHz
Memory: 4096MB RAM

I'm not that great with computers. My apologies.
Edit: Oh and should I just set everything in settings to false?
Edit 2: Oh and what I presume is my display card (display-device-chip type)
Intel(R) HD Graphics Family
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Dark.Revenant on June 23, 2014, 10:52:30 PM
Just setting "enableShaders" to false should do the trick.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.52)
Post by: Lcu on June 24, 2014, 05:53:40 AM
Is this Library compatible with exerelin?
Title: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.6)
Post by: Dark.Revenant on June 24, 2014, 06:26:12 AM
Yes (ShaderLib is compatible with everything), but Exerelin doesn't use any ShaderLib features as of yet, so all you'll get are lights/materials/normals on the vanilla ships/weapons.

Starsector+, Uomoz' Sector, and Vacuum use ShaderLib features.  Exerelin and (to my knowledge) Ironclads do not as of the time of writing.


ShaderLib Alpha v1.6

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.6 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.6.zip)
(MediaFire Mirror) (https://www.mediafire.com/?ryjtwgr3lhw5yr6)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.6 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.6.zip)
(MediaFire Mirror) (https://www.mediafire.com/?heu9rh7k9ks3494)

Alpha v1.6 (June 24, 2014)
- Added "reloadKey" option to settings.json
- Added method to ShaderAPI: void destroy()
- Added methods to ShaderLib: int getAuxiliaryBufferTexture(), int getAuxiliaryBufferId()
- Memory usage improved
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.6)
Post by: GeometryPrime on June 24, 2014, 06:47:36 PM
if I don't like the normal maps, can I turn that off, or at least turn it off until Blackrock has it too?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.6)
Post by: The Soldier on June 24, 2014, 08:04:31 PM
Yes, just go into the mod's settings.json in the main mod file and change the line from "true" to "false".
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.6)
Post by: Okim on June 25, 2014, 11:04:12 AM
So what do i need to do in order to make Ironclads compatible with this lib? Just create a material and a normal file for every single ship and gun in the mod?

As i can see a material file is a heavily brightened/contrusted version of the original sprite? No alphas and etc.
Normal map seems to be created with some map-making plugin for PS... might be difficult to create. What is it for, actually?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.6)
Post by: Dark.Revenant on June 25, 2014, 01:08:24 PM
You aren't forced to use normals/materials.  You can skip an arbitrary set of ships/weapons, though obviously the ideal case is a map for all objects.

Basically, material maps are what the lighting engine uses as the color/brightness of the surface.  Dark pixels get reflected less, light pixels get reflected more, the color of the shading (especially when using normals) differs, etc.

Normal maps are used for the lighting engine to add depth to the sprite.  So if a light appears to a ship's side, it will light that side of the ship with respect to its geometry.  The normals are generated with Crazy Bump, but need to be edited to maintain the original sprite's alpha channel.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.6)
Post by: Foxer360 on June 25, 2014, 05:04:18 PM
Maybe there are others, but I feel that a tutorial is necessary for both normal and material maps. A tutorial would also be an invaluable resource for upcoming modders in the future. 
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.6)
Post by: kazi on June 29, 2014, 04:49:03 PM
Okay now that I've been updating my mod to use this, a few bits of observations/criticism on the Full Version of Shaderlib currently available.

Some comments for DR:
-The normal maps are quite impressive, but the implementation is a bit off for many of the vanilla sprites (a lot of the material/normal maps could use quite a bit of tweaking). Although most of my playing has been in the simulator, most of the midline ships and some of the high tech ones are WAYYYYY to reflective for their own good. It seems like they are always "whited-out" once they start shooting/taking fire. The Onslaught is the worst offender, it looks like a strobe light dance party as soon as it starts firing, which gets really distracting (probably because of the extreme "flashiness" of ballistic weapons).
-Normal maps for vanilla are a little too "deep/overtextured." Bright lights will sometimes make the hull normal map super visible, which makes some of the vanilla ships look really weirdly 3D textured (in a bad way).
-Weapons are slightly too bright and flashy, especially light ballistic mounts. Tone down the weapon flashes and the amount of lighting for these.
-Beams illuminate their entire "original path" regardless of if they hit something. A beam that hits a shield or hull will continue lighting up everything in its path as if it didn't hit anything. It would be nice if they didn't do that going forwards and stopped illuminating things once they hit something. (Not sure if I explained that well.)
-A mod-specific or per-sprite option for normal map depth should be made available. Chances are, quality/depth of normal maps will differ greatly between mods, and allowing modders to specify an optimum depth for each normal map will help keep the graphics standardized.

Some comments for other modders looking to use this library:
-To create normal maps from 3D models, apply this material to your models in Blender. http://matrep.parastudios.de/index.php?action=view&material=57-normal-map&fc=14 (http://matrep.parastudios.de/index.php?action=view&material=57-normal-map&fc=14) Render as usual, and it will create a perfect normal map. Render baking DOES NOT WORK if you rendered your sprites in perspective (render baking only seems to create orthographic normal maps). I also advise against having lots of "little details" in your normal maps, the "major structural details only" approach works great and won't appear "overtextured." Don't worry about hard edges in the final map. (I can't help you if you're starting from 2D sprites.)
-Normal maps are not the be all, end all graphics must-have. Although they can look good, the change in graphics quality isn't all that huge and depends wildly from sprite to sprite. They aren't very noticeable at all on flat ships, but really add to ships with a lot of depth in the z-axis. So far normal maps only seem to be really "worth it" for cruisers and capitals.
-Normal maps can look REALLY REALLY bad if done poorly, and your ships will look just fine without them if you don't want to go to all the effort needed to implement them.
-Material maps do not appear to be necessary if you have a good normal map, although this might depend on your mod's color palette.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.6)
Post by: MesoTroniK on June 29, 2014, 05:08:02 PM
Spoiler
(http://i.imgur.com/elpF2l5.png) (http://youtu.be/Cq1RDTLcCYk)

Nothing http://i.imgur.com/ifpEC7G.jpg
Material + Normal maps http://i.imgur.com/szDIzt8.jpg

Nothing http://i.imgur.com/oovTmXi.jpg
Material + Normal maps http://i.imgur.com/KNYVq9c.jpg

Nothing http://i.imgur.com/LknUbkZ.jpg
Material + Normal maps http://i.imgur.com/Qqe7Ccj.jpg

Nothing http://i.imgur.com/dT7eyFl.jpg
Material + Normal maps http://i.imgur.com/lceFhLr.jpg

Nothing http://i.imgur.com/TgFtkqf.jpg
Material + Normal maps http://i.imgur.com/GVjSwpM.jpg
[close]


That stuff is a copy paste from my own thread showing ShaderLib stuff from a obsolete dev build of EXI. This is just my opinion take it as you will, but material maps are more important than normal maps.

And on top of this, without material and normal maps I would rather that dynamic lights do not exist at all. And for the record I still love the vanilla Starsector style...
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.6)
Post by: Dark.Revenant on June 29, 2014, 05:24:21 PM
-The normal maps are quite impressive, but the implementation is a bit off for many of the vanilla sprites (a lot of the material/normal maps could use quite a bit of tweaking). Although most of my playing has been in the simulator, most of the midline ships and some of the high tech ones are WAYYYYY to reflective for their own good. It seems like they are always "whited-out" once they start shooting/taking fire. The Onslaught is the worst offender, it looks like a strobe light dance party as soon as it starts firing, which gets really distracting (probably because of the extreme "flashiness" of ballistic weapons).
I've already redone them once before. I will never go back and do them for a third time, unless I'm paid to do it or something.  If you didn't know, in vanilla alone there are over five hundred material and normal maps to deal with, with more to come when the next update hits.  If someone else wants to do hand-tweaked high-quality material and normal maps for the vanilla ships/weapons, I will be happy to include them in ShaderLib with full accolades.  Otherwise, they're staying as-is.

Quote
-Normal maps for vanilla are a little too "deep/overtextured." Bright lights will sometimes make the hull normal map super visible, which makes some of the vanilla ships look really weirdly 3D textured (in a bad way).
There are multiple options in the settings file that deal with this.  If you have different defaults in mind, please do post your settings and illustrate why they are better, and I'll include them as the default settings in the next version.

Quote
-Weapons are slightly too bright and flashy, especially light ballistic mounts. Tone down the weapon flashes and the amount of lighting for these.
They have already been toned down multiple times.  I'm not sure how much more they can be toned down before an individual shot's light becomes impossible to perceive.  I'll try a 25% reduction in intensity.

Quote
-Beams illuminate their entire "original path" regardless of if they hit something. A beam that hits a shield or hull will continue lighting up everything in its path as if it didn't hit anything. It would be nice if they didn't do that going forwards and stopped illuminating things once they hit something. (Not sure if I explained that well.)
This will be fixed on the next version of Starsector.  Before that, it's plain impossible to fix the issue.

Quote
-A mod-specific or per-sprite option for normal map depth should be made available. Chances are, quality/depth of normal maps will differ greatly between mods, and allowing modders to specify an optimum depth for each normal map will help keep the graphics standardized.
I can add a column for this in the texture data CSV, but keep in mind that depth-transformation is not free and requires more GPU power.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.6)
Post by: kazi on June 29, 2014, 06:52:12 PM
Perhaps darkening the worst offender's materials maps with a levels adjustment might solve the "over bright" issue.

For the ballistics, it might not be an issue with the shot itself, perhaps just the "flash" effects (particularly with the autocannons)? Non ballistic weapons seem to be in a good spot right now in terms of lighting.

Looking forwards to the beam fix.

And yeah, I can see the sprite-specific depth column helping keep things consistent. I mainly see people using it to flatten certain sprites.

edit: after playing with things a bit, it looks like most of the issues I was griping about are just caused by the autocannons (esp. the Mark IX) and the assault chaingun. Those look like the only weapons that really need to be toned down.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.61)
Post by: Dark.Revenant on June 30, 2014, 12:49:51 AM
ShaderLib Alpha v1.61

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.61 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.61.zip)
(MediaFire Mirror) (https://www.mediafire.com/?qfdhkbdokpnfubd)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.61 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.61.zip)
(MediaFire Mirror) (https://www.mediafire.com/?kskdyoef0c7cz87)

Alpha v1.61 (June 30, 2014)
- Added "magnitude" column to texture data CSV for normal map magnitude changes per texture
- Modified vanilla ship material maps (darkened and increased contrast, across the board)
- Slightly tweaked vanilla lights
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.61)
Post by: kazi on June 30, 2014, 01:46:15 AM
You are super awesome. I just wanted to let you know that.  ;D
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.62)
Post by: Dark.Revenant on July 03, 2014, 03:11:49 AM
ShaderLib Alpha v1.62

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.62 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.62.zip)
(MediaFire Mirror) (https://www.mediafire.com/?zicp9dgnp3g3y6d)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.62 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.62.zip)
(MediaFire Mirror) (https://www.mediafire.com/?w3nztkyyze434nh)

Alpha v1.62 (July 3, 2014)
- Added surface map support (only used if normal maps are enabled)
- Added method to StandardLight: void makePermanent()
- Added method to ShaderLib: void setWeaponShadowDirection(Vector2f direction)
- Added fixed-direction shadows to weapons when the ship is lit up with lights
- Rare "light leaks" eliminated
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.62)
Post by: Baleur on July 07, 2014, 01:14:48 AM
This is so awesome  ;D
Does it work with Exerelin and custom ship packs like Bushi etc?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.62)
Post by: Dark.Revenant on July 07, 2014, 03:19:58 AM
By "work", lights will cast onto all modded ships/weapons and it won't crash or anything.

However, if those mods don't have features like light data or material/normal maps, it won't be as good and their weapons won't create lights.
Title: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.63)
Post by: Dark.Revenant on July 08, 2014, 01:12:01 AM
ShaderLib Alpha v1.63

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.63 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.63.zip)
(MediaFire Mirror) (https://www.mediafire.com/?x8kj9cvujsssckj)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.63 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.63.zip)
(MediaFire Mirror) (https://www.mediafire.com/?nwek4bhgm63l440)

Alpha v1.63 (July 8, 2014)
- Fixed weapon blend function override bug
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.64)
Post by: Dark.Revenant on July 09, 2014, 01:12:03 AM
Quick update:

ShaderLib Alpha v1.64

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.64 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.64.zip)
(MediaFire Mirror) (https://www.mediafire.com/?jbzfgdmq3eznd63)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.64 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.64.zip)
(MediaFire Mirror) (https://www.mediafire.com/?ie7up31e8votcu8)


Alpha v1.64 (July 9, 2014)
- Fixed major memory leak when reloading shaders
- Changed default reload key to F11
- Lighting shader now runs even if no lights are onscreen (smooths performance and makes things more consistent)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.64)
Post by: xenoargh on July 09, 2014, 01:01:23 PM
Yay, to all of that :)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.65)
Post by: Dark.Revenant on July 09, 2014, 09:20:31 PM
Sorry for yet another quick update, but it's enough to be worth the effort of pitting it out there, IMO.

ShaderLib Alpha v1.65

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.65 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.65.zip)
(MediaFire Mirror) (https://www.mediafire.com/?usk70a8bn4flzil)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.65 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.65.zip)
(MediaFire Mirror) (https://www.mediafire.com/?r18u5782ptf5iyd)


Alpha v1.65 (July 9, 2014)
- Changed default reload key to F10
- Updated lighting shader to avoid minor graphics glitches on the edges of objects when using surface maps
Title: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: Dark.Revenant on July 13, 2014, 05:52:00 AM
Beam lights now work properly.  Well, almost properly, but better than before.  There is probably a minor performance hit involved, but whatever.

ShaderLib Alpha v1.66

Full Edition
Includes vanilla normal maps and high-resolution ripple distortion
Download Alpha v1.66 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.66.zip)
(MediaFire Mirror) (https://www.mediafire.com/?qn25j9rt641ks50)


Basic Edition
Vanilla normal maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.66 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.66.zip)
(MediaFire Mirror) (https://www.mediafire.com/?w2lfuh6lnji8e5a)


Alpha v1.66 (July 13, 2014)
- Shaders being disabled no longer stops a ShaderAPI from being loaded (they can double as EveryFrameCombatPlugins now)
- Beam lights and fast projectile lights are more accurate on impact with objects (but not perfect until the next Starsector update)
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: kazi on July 17, 2014, 11:52:44 PM
Oh man, the changes to beam lighting fx are fantastic. Nice work!
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: ValkyriaL on July 22, 2014, 09:37:34 AM
I must have missed something, because all the light from my weapons have disappeared. ??? did you make any changes that would require me to alter my CSV?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: Dark.Revenant on July 22, 2014, 02:09:08 PM
Are you sure that ShaderLib is actually on?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: ValkyriaL on July 22, 2014, 02:29:57 PM
I am VERY sure it's on, Shaderlib 1.66 is toggled, none of my weapons have light effects on them, neither has the projectiles they fire.

further testing concludes that it is only my weapons that are affected, vanilla and other mods weapons work as intended.

EDIT: It might actually have been me thrashing about my files that caused this, allow me to make a few changes. :)

EDIT2: Obviously it was my fault, had missed to switch lines when changing a value so i removed "ID". "DAMMIT! i wanted to blame it on someone else for once!!"
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: Dark.Revenant on July 22, 2014, 03:38:42 PM
Glad to see it's resolved.  I can see why that would have taken a while to find.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: r4plez on July 27, 2014, 01:51:36 PM
Hello, am new here, but already love this game :)

I have small problem with making this mod to work on my game. When i active this mod i see no difference in game.. no extra lightning effects, no ripple distortion whatsoever. This is strange because when i tried last night UomozSector 1.3 he's mod was working and ShaderLib was also working with it. But i want only ShaderLib without 3rd party mods like Uomoz's. Any ideas?

Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: Dark.Revenant on July 27, 2014, 02:24:33 PM
Shield/explosion effects only happen in Uomoz's Sector and Starsector+.  However, weapon/ship lighting should happen, at the very least with vanilla weapons (not every mod has lighting data).  The only reason I can see that it would not happen with vanilla weapons is you disabled the mod somehow or your system specs are too low for ShaderLib.

Please post your system specs (CPU, video card) and check starsector.log for any "ERROR"-class lines (just do a search for "ERROR" and post any matching lines).
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: r4plez on July 27, 2014, 02:40:44 PM
My system spec:

Code
Time of this report: 7/27/2014, 23:29:44
       Machine name: DESANT-PC
   Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.140303-2144)
           Language: Polish (Regional Setting: Polish)
System Manufacturer: To Be Filled By O.E.M.
       System Model: To Be Filled By O.E.M.
               BIOS: BIOS Date: 03/27/12 14:26:42 Ver: 04.06.04
          Processor: AMD Phenom(tm) II X4 955 Processor (4 CPUs), ~4.0GHz
             Memory: 8192MB RAM
Available OS Memory: 8188MB RAM
          Page File: 3161MB used, 7024MB available
        Windows Dir: C:\Windows
    DirectX Version: DirectX 11
DX Setup Parameters: Not found
   User DPI Setting: Using System DPI
 System DPI Setting: 96 DPI (100 percent)
    DWM DPI Scaling: Disabled
     DxDiag Version: 6.01.7601.17514 64bit Unicode

Those are errors i found in :
Code
9360 [Thread-5] ERROR com.fs.starfarer.loading.WeaponSpreadsheetLoader  - Weapon spec [br_ciws] not found in weapon_data.csv
9360 [Thread-5] ERROR com.fs.starfarer.loading.WeaponSpreadsheetLoader  - Weapon spec [ssp_tpc] not found in weapon_data.csv
9360 [Thread-5] ERROR com.fs.starfarer.loading.WeaponSpreadsheetLoader  - Weapon spec [ms_3wave] not found in weapon_data.csv
9360 [Thread-5] ERROR com.fs.starfarer.loading.WeaponSpreadsheetLoader  - Weapon spec [target_painter] not found in weapon_data.csv
9360 [Thread-5] ERROR com.fs.starfarer.loading.WeaponSpreadsheetLoader  - Weapon spec [sachumodo_weapon] not found in weapon_data.csv
9360 [Thread-5] ERROR com.fs.starfarer.loading.WeaponSpreadsheetLoader  - Weapon spec [ms_stationkeeper_2] not found in weapon_data.csv
9360 [Thread-5] ERROR com.fs.starfarer.loading.WeaponSpreadsheetLoader  - Weapon spec [ms_stationkeeper_1] not found in weapon_data.csv

Also i have replaced java scrips because i couldn't load my saves with default one's. I just cpyed jre7 64b in to jre forder.

Apart of that i thought i will be able to see Shield/explosion effects in ShaderLib like it was shown on screens in 1st page :(  Is there no way to enable those without Uomoz's Sector or Starsector+?

Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: ValkyriaL on July 27, 2014, 02:49:09 PM
I would recommend having starsector+ for the ripple effects, as it makes the base game much more enjoyable along with all the changes and ships that mod brings, I would also recommend installing eternal nox sounds, all this together with shaderlib makes almost a completely new game.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: r4plez on July 27, 2014, 03:02:41 PM
It's my second day with this awesome game so i wanted to have it as pure as possible just to learn it and improve my 'pew/pew' and flying skill  ;)  But after reading about Starsector+ i think will try it. I will also look at eternal nox sounds. Thanks for advice.


Edit. ShaderLib is now working with Starsector+ thanks Dark.Revenant for making those great mods.






Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: Dark.Revenant on July 27, 2014, 04:41:33 PM
Glad to help.  Starsector+ is basically as "pure" as it gets when it comes to large mods, considering it doesn't change any of the base game mechanics, just modernizes things a bit and updates balance/progression.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: celestis on August 12, 2014, 02:39:58 AM
Seems like the Basic release has invalid settings file due to duplicate "use64BitBuffer" property in json. As a result, all shader effects are not working. Removing one of 2 records resolves the issue.
Thanks
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: Dark.Revenant on August 12, 2014, 02:49:26 AM
I am saddened that I missed that.  Will be fixed for the next update.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: Lcu on August 16, 2014, 12:35:33 AM
If you want to make custom material maps for a mod, what is the proper file directory to put it?
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.66) (Beams fixed!)
Post by: Dark.Revenant on August 16, 2014, 09:03:40 AM
You can put them in any directory.  However, these textures must be added via settings.json and linked via the texture data csv, as explained in the first post and shown via example in the library itself.
Title: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.7)
Post by: Dark.Revenant on August 30, 2014, 10:54:54 PM
We've got cool stuff, namely the fact that now every vanilla ship and weapon now has material, normal, and surface maps.  Have fun.

(http://i.imgur.com/vPv4Tfp.gif) (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.7.zip)

ShaderLib Alpha v1.7

Note: If your computer can't run ShaderLib, disable it through settings.json in the ShaderLib folder, but keep the mod enabled.

Full Edition
Includes vanilla normal and surface maps and high-resolution ripple distortion
Download Alpha v1.7 (http://www.sc2mafia.com/Starsector/ShaderLib%20Alpha%20v1.7.zip)
(MediaFire Mirror) (https://www.mediafire.com/?52vn3fbjoodi9ds)


Basic Edition
Vanilla normal maps and surface maps not included, low-memory ripple distortion, and performance-optimized default settings
Download Basic Alpha v1.7 (http://www.sc2mafia.com/Starsector/ShaderLib%20Basic%20Alpha%20v1.7.zip)
(MediaFire Mirror) (https://www.mediafire.com/?dttez4mr2apwm23)


Alpha v1.7 (August 30, 2014)
- Surface maps added to all vanilla ships and weapons
- Issue with ShaderLib Basic fixed
- Version Checker support added
- Rare crashes fixed
- Benchmark mission added
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.7)
Post by: Bob McBobbyton on September 12, 2014, 11:04:58 AM
every time I start up the game with the shaderLib mod enabled there is extreme lag and miniature versions of my screen appear in the bottom left corner. help plz.
Title: Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.7)
Post by: Dark.Revenant on September 12, 2014, 01:20:10 PM
every time I start up the game with the shaderLib mod enabled there is extreme lag and miniature versions of my screen appear in the bottom left corner. help plz.

I suspect your computer doesn't meet the minimum specs.  Can you post your system specs and screenshot of what is happening?  I need your CPU, video card, and amount of memory.
Title: [Graphics] ShaderLib Alpha v1.7
Post by: Dark.Revenant on September 13, 2014, 12:38:16 AM
I have compiled some formalized system specs for ShaderLib:

System Requirements
Vanilla
256 MB Video Memory

ShaderLib Basic

ShaderLib Full

Minimum
GeForce 6800, Radeon X850, or Intel HD Graphics 3000

Low
GeForce 8600, Radeon HD 2600, or Intel HD Graphics 4000

Medium
GeForce 8800 or Radeon HD 2900

Recommended
GeForce GTX 260 or Radeon HD 4870


Also, here are some comparison images to see exactly what the various maps do, visually:

Vanilla
Spoiler
(http://i.imgur.com/E1iHayJ.jpg) (http://imgur.com/E1iHayJ)
[close]
No Maps
Spoiler
(http://i.imgur.com/ExSIj3K.jpg) (http://imgur.com/ExSIj3K)
[close]
Material Maps Only
Spoiler
(http://i.imgur.com/xYMCjOH.jpg) (http://imgur.com/xYMCjOH)
[close]
Normal Maps Only
Spoiler
(http://i.imgur.com/P6o1sTq.jpg) (http://imgur.com/P6o1sTq)
[close]
Material and Normal Maps
Spoiler
(http://i.imgur.com/L26ez8A.jpg) (http://imgur.com/L26ez8A)
[close]
Material, Normal, and Surface Maps
Spoiler
(http://i.imgur.com/c5yA2UM.jpg) (http://imgur.com/c5yA2UM)
[close]


And here's another series of images:

Vanilla
Spoiler
(http://i.imgur.com/BOMqjWB.jpg) (http://imgur.com/BOMqjWB)
[close]
No Maps
Spoiler
(http://i.imgur.com/kIKfOP8.jpg) (http://imgur.com/kIKfOP8)
[close]
Material Maps Only
Spoiler
(http://i.imgur.com/6YXHuCs.jpg) (http://imgur.com/6YXHuCs)
[close]
Normal Maps Only
Spoiler
(http://i.imgur.com/NJ7FDqa.jpg) (http://imgur.com/NJ7FDqa)
[close]
Material and Normal Maps
Spoiler
(http://i.imgur.com/l8wNC4c.jpg) (http://imgur.com/l8wNC4c)
[close]
Material, Normal, and Surface Maps
Spoiler
(http://i.imgur.com/J3t6XYs.jpg) (http://imgur.com/J3t6XYs)
[close]
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Bob McBobbyton on September 13, 2014, 06:35:43 AM
this is what it looks like

[attachment deleted by admin]
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Dark.Revenant on September 13, 2014, 12:22:52 PM
I understand, but you still have to send me your system specs.

CPU

Memory

Video
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Bob McBobbyton on September 13, 2014, 02:35:23 PM
how do I do that?
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Dark.Revenant on September 13, 2014, 03:00:47 PM
Start > Run > "dxdiag"

The system specs are on the System and Display tabs.
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Bob McBobbyton on September 14, 2014, 04:29:13 AM
CPU:
AMD Athlon II X2 245 processor (2 CPUs), 2.9 GHz

Memory:
4096 MB RAM

Video:
ATI Raedon 3000 graphics
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Debido on September 14, 2014, 05:31:38 AM
Have a look at the display tab Bobby.
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Dark.Revenant on September 14, 2014, 02:12:42 PM
CPU:
AMD Athlon II X2 245 processor (2 CPUs), 2.9 GHz

Memory:
4096 MB RAM

Video:
ATI Raedon 3000 graphics

Your graphics chip does not meet the minimum requirements for ShaderLib.
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Schwartz on September 25, 2014, 10:09:12 PM
Ever since I switched from a GTX 275 to a R9 270X, my formerly smooth FPS has been massively reduced to 15-20 in big battles. This is with both 14.04 and 14.08 Catalyst drivers. What can I do?
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Dark.Revenant on September 26, 2014, 12:32:57 AM
Your card is only marginally slower than mine, so you should be CPU-limited (as I am), not GPU-limited.

Check your video card usage (using any kind of hardware monitoring or overclocking tool).  Does it reach 100% in the battle?  I have fixed all known AMD compatibility issues, so unless there's some GLSL instruction I'm using that does not play nice with AMD cards (which should not be the case; on the AMD GLSL compiler I profiled the shaders on, the performance spec looked fine) I have no idea what could cause this if it is an issue with your type of card.

If you find that your card is not reaching 75-100%, then that means one of two things: either your card is limiting its output and slowing the game down that way, or somehow the change of card caused bugs/problems that result in a much higher CPU load.  If that's the case, it's up to you to fix that on your end.

If your card is reaching 75-100% load, then I need you to try different settings via settings.json and see if that improves things.  Use a consistent mission like The Last Hurrah to gauge performance.
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Schwartz on September 26, 2014, 12:54:15 AM
Okay, the card isn't even breaking 20% load and the CPUs tend to stay under 50% load. But the game runs terribly. Massive FPS drops even on the strategic view and slowdowns during battles.

I did get rid of the drivers properly, used DDU in safe mode and then installed the new ones. Maybe I need to wipe some old config files for the game?

Edit: Tried a bunch of things. It's happening in vanilla Starsector as well so it's not a ShaderLib issue. Of course if you know why AMD is throwing such a fit with the game I'd be happy to hear it.
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Dark.Revenant on September 26, 2014, 09:55:01 AM
You may want to report this to Alex, then, since he's the one who has control over the vanilla code and is gearing up for the imminent next release of the game.
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: AMDAMK on October 06, 2014, 07:31:37 PM
Have a nice error, when try to start it without mods:

Spoiler
java.lang.NoClassDefFoundError: org/dark/shaders/util/ShaderLib
   at data.scripts.IIModPlugin.onApplicationLoad(IIModPlugin.java:55)
   at com.fs.starfarer.loading.OooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
   at com.fs.oOOO.A.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.dark.shaders.util.ShaderLib
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 6 more
[close]
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Foxer360 on October 06, 2014, 07:40:21 PM
Looks like you deselected Shaderlib and left another mod that requires shaderlib on. Translated, It was searching for shaderlib and didn't find it.
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Dark.Revenant on October 06, 2014, 08:11:42 PM
Interstellar Imperium requires ShaderLib.
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: AMDAMK on October 06, 2014, 08:33:58 PM
Quote
Interstellar Imperium requires ShaderLib.
Looks like you deselected Shaderlib and left another mod that requires shaderlib on. Translated, It was searching for shaderlib and didn't find it.

Yep, forgot to desabled. Must oversee it.




E^1: Any ideas, why I only see the full Shaderl.-mod and not not both; Shaderl.-m. full and Shaderl.-m. Standard? I have both, both in */Starsector/mods.

E^2: It seem, it can be only one Shadermod in the mod folder, to show in ModLauncher... When both at the sam time in the mod folder, i'll see only the full shaderlib mod in the modlauncher..
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Kommodore Krieg on October 21, 2014, 01:55:31 PM
Will this work with .65a?
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Dark.Revenant on October 21, 2014, 03:14:42 PM
No.

I am making an update but I am currently extremely busy with schoolwork.  I will most likely wait for the hotfix patch.
Title: Re: [Graphics] ShaderLib Alpha v1.7
Post by: Dark.Revenant on October 21, 2014, 05:24:40 PM
Confirming that ShaderLib Beta v1.0 will be released in approximately 1-2 weeks, depending on when the next patch is released.  I may release a stop-gap 0.9 version tomorrow, lacking a few important features, just to get something out the door.
Title: [0.65a] ShaderLib Beta v0.9
Post by: Dark.Revenant on October 23, 2014, 02:41:09 AM
Major update!  This should help in terms of memory performance; due to smart texture loading, you can toggle settings to ease up VRAM usage.

Modders: settings.json is not used for texture definitions anymore.  See core_texture_data.csv for how to go about these changes.


(http://i.imgur.com/vPv4Tfp.gif) (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%20v0.9.zip)

Download ShaderLib Beta v0.9 (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%20v0.9.zip)
Download Mirror (https://www.mediafire.com/?ezhs1hjdfqdimmz)

We also recommend Version Checker 1.2 (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.


Beta v0.9 (October 23, 2014)
- Updated for Starsector 0.65a
- Shaders no longer draw on top of the UI
- Major stability update
- Shaders should behave more consistently
- Asteroids and missiles are now affected by lighting
- Weapon unders are now affected by lighting (barrels and loaded missiles are broken for now)
- All maps updated to reflect new ship sprites; new maps added for new ships/skins
- ShaderLib settings file renamed to "shaderSettings.json"
- Removed static texture definitions; mods should no longer define textures in settings.json
- Added smart texture loading to dramatically reduce memory usage when options are turned down
- Removed "category" and "key" columns from the texture data CSV
- Added "path" column to the texture data CSV
- Added "loadMaterial" option to shaderSettings.json
- Added "loadSurface" option to shaderSettings.json
- Added "useLargeRipple" option to shaderSettings.json
- Split "brightnessScale" to "intensityScale" and "sizeScale" options in shaderSettings.json
- Added method to DistortionAPI: float getArcAttenuationWidth()
- Several methods renamed or changed in some manner
- Removed ShaderLib.setVanillaViewport()
- Removed weapon "shadows" (the effect never worked quite right)
Title: Re: [0.65a] ShaderLib Beta v0.9
Post by: MasterGlink on October 25, 2014, 08:05:02 AM
Any way to enable the distortions and other effects in the vanilla game?
Title: Re: [0.65a] ShaderLib Beta v0.9
Post by: Dark.Revenant on October 25, 2014, 03:13:12 PM
Those are implementation-dependent.  Uomoz's Sector and Starsector+, when updated, will provide those scripts.
Title: Re: [0.65a] ShaderLib Beta v0.9
Post by: MasterGlink on October 25, 2014, 03:57:22 PM
Hmm... that's unfortunate. Not to devalue the work of modders, but is the implementation itself particularly difficult? I am a developer familiar with Java, but I have very limited experience and exposure to game development and modding. I'd be willing to go so far as too implement it myself, since all I want right now is that amazing shield distortion effect.
Title: Re: [0.65a] ShaderLib Beta v0.9
Post by: Dark.Revenant on October 25, 2014, 06:59:15 PM
The script I used in SS+ for shield distortions is in the mod jar.  You are free to copy the source over to a personal mod, if you wish.
Title: Re: [0.65a] ShaderLib Beta v0.9
Post by: MasterGlink on October 25, 2014, 08:54:27 PM
Hey, thanks for the help, I really appreciate it. Understanding all of the code and just about nothing else is a very confusing feeling. I've found the classes you're referring to, now I just need to figure out what to do with them... Still, it will be worth it in the end, so I will press on!
Title: Re: [0.65a] ShaderLib Beta v0.9
Post by: Ghoti on October 28, 2014, 02:38:02 PM
edit edit edit: never mind had something really screwy happen on my machine. Works fine T.T

getting this trace from shader lib from 65a-rc1 on linux

Quote
15286 [Thread-5] INFO  com.fs.graphics.TextureLoader  - Cleaned buffer for texture graphics/ships/atlas_af.png (using cast)
15336 [Thread-5] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [shaderSettings.json]
15344 [Thread-5] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [shaderSettings.json]
15381 [Thread-5] ERROR com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - java.lang.NoSuchMethodError: com.fs.starfarer.api.SettingsAPI.loadTexture(Ljava/lang/String;)V
java.lang.NoSuchMethodError: com.fs.starfarer.api.SettingsAPI.loadTexture(Ljava/lang/String;)V
   at org.dark.shaders.util.TextureData.readTextureDataCSVNoOverwrite(TextureData.java:211)
   at org.dark.shaders.ShaderModPlugin.onApplicationLoad(ShaderModPlugin.java:41)
   at com.fs.starfarer.loading.H.super(Unknown Source)
   at com.fs.A.oOOO.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:744)

I haven't got a dev environment for startsector set up right now, so I can't give you a fix right now.

edit: Sorry, I meant to say RC3, silent update O.o

edit edit: oh no wait the launcher is RC3, I think the version is still RC1 :3
Title: [0.65a] ShaderLib Beta v1.0
Post by: Dark.Revenant on November 03, 2014, 10:13:18 PM
Update to bring everything up to scratch.  Barrels and loaded missiles are now lit!


(http://i.imgur.com/vPv4Tfp.gif) (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%20v1.0.zip)

Download ShaderLib Beta v1.0 (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%20v1.0.zip)
Download Mirror (https://www.mediafire.com/?b47u962fdajdd9v)

We also recommend Version Checker 1.2 (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.


Beta v1.0 (November 3, 2014)
- Weapon barrels and loaded missiles are now affected by lighting
- Fixed bug with WaveDistortion
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: Nhoj on November 04, 2014, 07:17:45 PM
Keep crashing when I deploy for a firefight.

http://puu.sh/cDN3W/7476014edc.log

There's starsector.log
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: LazyWizard on November 04, 2014, 07:20:47 PM
Keep crashing when I deploy for a firefight.

http://puu.sh/cDN3W/7476014edc.log

There's starsector.log

You need to install the latest Starsector update. You can download .65.1a here (http://fractalsoftworks.com/2014/11/03/starsector-0-65-1a-release/).
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: Nhoj on November 04, 2014, 07:26:29 PM
Keep crashing when I deploy for a firefight.

http://puu.sh/cDN3W/7476014edc.log

There's starsector.log

You need to install the latest Starsector update. You can download .65.1a here (http://fractalsoftworks.com/2014/11/03/starsector-0-65-1a-release/).
Whoops, must have snuck up on me, I just bought the game.

With this out do you think that 90% of the mods will update to be playable?
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: LazyWizard on November 04, 2014, 07:57:38 PM
Whoops, must have snuck up on me, I just bought the game.

With this out do you think that 90% of the mods will update to be playable?

It's hard to say. The latest major SS update rewrote many of the core campaign mechanics, and virtually every mod on the forum broke completely as a result. Supporting these changes requires rewriting huge chunks of campaign code (especially for mods like SS+, U'sS and Vacuum that have extensive custom campaign scripting). This is why utility mods that don't mess with the campaign were updated within hours/days of the update's release, whereas even weeks later only a handful of faction mods have made the leap to .65a. Now that several modders have experience with the new market system, I expect that more faction mods will be updated soon with their help. :)

Fair warning, a lot of mods probably won't get an update. A lot of the authors of the older mods have moved on or are waiting for the game to reach 1.0 before updating, and others are too busy IRL to put in the large amount of work that .65a compatibility requires.
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: Nhoj on November 04, 2014, 08:14:06 PM
It's hard to say. The latest major SS update rewrote many of the core campaign mechanics, and virtually every mod on the forum broke completely as a result. Supporting these changes requires rewriting huge chunks of campaign code (especially for mods like SS+, U'sS and Vacuum that have extensive custom campaign scripting). This is why utility mods that don't mess with the campaign were updated within hours/days of the update's release, whereas even weeks later only a handful of faction mods have made the leap to .65a. Now that several modders have experience with the new market system, I expect that more faction mods will be updated soon with their help. :)

Fair warning, a lot of mods probably won't get an update. A lot of the authors of the older mods have moved on or are waiting for the game to reach 1.0 before updating, and others are too busy IRL to put in the large amount of work that .65a compatibility requires.

Oh well. I was trying to get an old version of SS running to play some of the mods but I ran into error after error and gave up.

Thanks for the help!
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: Plasmatic on November 06, 2014, 01:06:32 PM
Just downloaded v1.0 of Shaderlib and tried to continue on my previous save.. only every time I try to deploy my ships I get:

Spoiler
41946 [Thread-5] ERROR com.fs.starfarer.combat.D  - java.lang.NullPointerException
java.lang.NullPointerException
   at com.fs.starfarer.combat.entities.ship.A.J.getBarrelSpriteAPI(Unknown Source)
   at org.dark.shaders.util.ShaderLib.renderForeground(ShaderLib.java:353)
   at org.dark.shaders.util.ShaderLib.isForegroundEmpty(ShaderLib.java:595)
   at org.dark.shaders.light.LightShader.drawLights(LightShader.java:725)
   at org.dark.shaders.light.LightShader.renderInWorldCoords(LightShader.java:397)
   at org.dark.shaders.util.ShaderHook.renderInWorldCoords(ShaderHook.java:116)
   at com.fs.starfarer.title.C.K$Oo.new(Unknown Source)
   at com.fs.starfarer.combat.oOOO.B.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.oOoO.Oôo000(Unknown Source)
   at com.fs.super.A.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.D.super(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]

What is wrong?
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: Dark.Revenant on November 06, 2014, 02:56:55 PM
You have to update Starsector.
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: Plasmatic on November 06, 2014, 03:09:54 PM
You have to update Starsector.

Yeah, just now realized Alex came out with a 0.65.1 Already had 0.65a
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: OOZ662 on November 08, 2014, 06:47:08 PM
Mod still claims to be v0.9 in the mod selection window.
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: Dark.Revenant on November 08, 2014, 07:10:24 PM
Mod still claims to be v0.9 in the mod selection window.

I'm aware of this.  I didn't feel it was worth updating just for that, though. :)
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: Vakuza on November 09, 2014, 12:59:14 PM
Whenever an effect that uses the ShaderLib is played the UI remains from previous frames resulting in a weird layering which progresses and ends up looking like what happens when you dragged a window around in a frozen/lagged Windows XP. I have a GTX 760M with drivers up to date so I don't think graphics card is a problem, any ideas?

This is when using the starsector+ mod.
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: Dark.Revenant on November 09, 2014, 03:10:58 PM
I am going to need more information:

Does this effect persist with lights off and distortions on?
Does this effect persist with lights on and distortions off?
Does this effect persist with lights on but bloom off?
What is your operating system?
Title: Re: [0.65a] ShaderLib Beta v1.0
Post by: Vakuza on November 10, 2014, 02:33:22 AM
I am going to need more information:

Does this effect persist with lights off and distortions on?
Does this effect persist with lights on and distortions off?
Does this effect persist with lights on but bloom off?
What is your operating system?

OS = Windows 8.1
CPU = i7 @ 2.4GHz
RAM = 8GB DRAM

How can I toggle the lights / bloom / distortion?

AFAIK it happens when pulse lasers hit shields, not sure what other weapons trigger it though.
Title: [0.65.1a] ShaderLib Beta v1.01
Post by: Dark.Revenant on November 10, 2014, 03:02:00 AM
See if this helps.  Otherwise, go into shaderSettings.json and disable distortions.


(http://i.imgur.com/vPv4Tfp.gif) (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%20v1.01.zip)

Download ShaderLib Beta v1.01 (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%20v1.01.zip)
Download Mirror (https://www.mediafire.com/?6dmrcixf5ubc3mi)

We also recommend Version Checker 1.2 (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.


Beta v1.01 (November 10, 2014)
- Made framebuffers more compatible, should resolve some bugs
- Added methods to ShaderLib: boolean useBufferEXT(), boolean useBufferARB(), boolean useBufferCore()
Title: Re: [0.65.1a] ShaderLib Beta v1.01
Post by: Vakuza on November 10, 2014, 04:02:34 AM
See if this helps.  Otherwise, go into shaderSettings.json and disable distortions.

The update didn't help, but disabling distortions did; thanks! I presume my Nvidia card isn't being used which is rather peculiar...
Title: Re: [0.65.1a] ShaderLib Beta v1.01
Post by: Dark.Revenant on November 10, 2014, 04:09:06 AM
I believe your laptop is using your integrated card, which can cause issues.  You should research into ways to force your 760M to work for Starsector.
Title: Re: [0.65.1a] ShaderLib Beta v1.01
Post by: Vakuza on November 10, 2014, 04:24:04 AM
I believe your laptop is using your integrated card, which can cause issues.  You should research into ways to force it to work for Starsector.

It's set now, distortions work fine now and I have to say they look pretty funky. Thanks for the help ^^
Title: Re: [0.65.1a] ShaderLib Beta v1.01
Post by: Carroy on November 12, 2014, 01:46:53 PM
When I installed the mod I noticed that everything felt a bit less smooth, fraps tells me its locked at 30fps when its toggled.

Took a peek at the shadersettings file but cant find anything related to fps, is there any way to make it higher?
Title: Re: [0.65.1a] ShaderLib Beta v1.01
Post by: Dark.Revenant on November 12, 2014, 01:57:38 PM
You should turn off vsync from Starsector's settings.json.  If you fall below 60 fps at all (say, to 59 fps) what vsync does is latch you down to just 30 fps.
Title: Re: [0.65.1a] ShaderLib Beta v1.01
Post by: Carroy on November 12, 2014, 03:46:43 PM
Worked like a charm, 61 -62 at all times now.

It only ever went to 59~ish when I called in reinforcements in the benchmark fight(best thing ever btw), is that enough to lock it to 30 for the rest of the fight?

anyway, thanks a bunch!
Title: Re: [0.65.1a] ShaderLib Beta v1.01
Post by: Carroy on November 18, 2014, 04:51:46 PM
If you fire the HIL over and over again you get a really bright spot, you then proceed to fly through that bright spot.  ;D
Spoiler
(http://i.imgur.com/4K1ErFq.png)
[close]
Title: Re: [0.65.1a] ShaderLib Beta v1.01
Post by: TheBawkHawk on November 18, 2014, 05:04:25 PM
If you fire the HIL over and over again you get a really bright spot, you then proceed to fly through that bright spot.  ;D
Spoiler
(http://i.imgur.com/4K1ErFq.png)
[close]

I think you just accidentally started to transcend to the next plane of existence.
Title: Re: [0.65.1a] ShaderLib Beta v1.01
Post by: Dark.Revenant on November 18, 2014, 05:20:37 PM
If you fire the HIL over and over again you get a really bright spot, you then proceed to fly through that bright spot.  ;D
Spoiler
(http://i.imgur.com/4K1ErFq.png)
[close]

Known vanilla bug; I reported that to Alex a few weeks ago.
Title: [0.65.1a] ShaderLib Beta v1.02
Post by: Dark.Revenant on December 08, 2014, 01:50:49 AM
Major performance overhaul in this update.  Big, worst-case battles should be up to 20% faster!

(http://i.imgur.com/vPv4Tfp.gif) (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%20v1.02.zip)

Download ShaderLib Beta v1.02 (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%20v1.02.zip)
Download Mirror (https://www.mediafire.com/?fuunm9z6cs3ts9d)

We also recommend Version Checker 1.2b (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.


Beta v1.02 (December 8, 2014)
- Code review and cleanup
- Code optimizations: up to a 20% increase in frame rate
Title: [0.65.1a] ShaderLib Beta 1.03
Post by: Dark.Revenant on January 08, 2015, 07:00:59 PM
More optimizations and fixes, and a few under-the-hood features.

(http://i.imgur.com/vPv4Tfp.gif) (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.03.zip)

Download ShaderLib Beta 1.03 (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.03.zip)
Download Mirror (https://www.mediafire.com/?tmi760j9i599u27)

We also recommend Version Checker 1.3 (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.


Beta 1.03 (January 8, 2015)
- Additional optimizations
- Fixed loaded missile lighting
- Added Performance Test mission
- Added method to DistortionShader: void removeDistortion(DistortionAPI distortion)
- Added method to LightShader: void removeDistortion(DistortionAPI distortion)
Title: Re: [0.65.1a] ShaderLib Beta 1.03
Post by: Lcu on January 20, 2015, 01:33:48 AM
How did my old, bulky laptop that can't run Ironclads can run this but not my new laptop?
Amazing.
Title: Re: [0.65.1a] ShaderLib Beta 1.03
Post by: Dark.Revenant on January 20, 2015, 01:42:47 AM
Well, the new laptop could be trying to use a crappy low-power chip to use ShaderLib.  Compared to the old but relatively production-tier device in your old laptop, it's probably worse.
Title: Re: [0.65.1a] ShaderLib Beta 1.03
Post by: Lcu on January 22, 2015, 12:10:44 AM
Well, both use the same graphics card, Intel HD graphics card *facepalm*, and in terms of everything else, its superior.
Title: Re: [0.65.1a] ShaderLib Beta 1.03
Post by: Dark.Revenant on January 22, 2015, 12:12:13 AM
Are you use the drivers are updated?  People with HD 3000 chips have had problems before.
Title: Re: [0.65.1a] ShaderLib Beta 1.03
Post by: Lcu on January 22, 2015, 12:25:42 AM
Yep, i used the 3000. Nevermind.
Title: Re: [0.65.1a] ShaderLib Beta 1.03
Post by: otariidae on February 09, 2015, 07:49:35 AM
The mod's lighting effects look dandy! However I don't seem to see any distortion effects at all. The test mission with the numpad commands allowed me to spawn some distortions but I have not seen any "naturally occurring" distortions anywhere during standard gameplay. My GPU is a GTX-650 and drivers are currently up to date.

P.S. I forgot to mention I have examined but have not touched the config file at all!
Title: Re: [0.65.1a] ShaderLib Beta 1.03
Post by: Tartiflette on February 09, 2015, 08:01:30 AM
Ripples are mod implementation dependent, like SS+ or the Templars.
Title: Re: [0.65.1a] ShaderLib Beta 1.03
Post by: Dark.Revenant on February 09, 2015, 09:04:01 AM
SS+ has a plugin with shield ripples and a plugin that involves ripples when a ship explodes, Templars have numerous distortions, Blackrock has several distortions, etc.  It depends on the mod, really.
Title: Re: [0.65.1a] ShaderLib Beta 1.03
Post by: otariidae on February 09, 2015, 11:19:59 AM
Ah, shucks. I was hoping I could get distortion out of just vanilla. I could make do with just the pretty lighting effects, then. Thanks for the mod!
Title: [0.65.2a] ShaderLib Beta 1.04
Post by: Dark.Revenant on February 16, 2015, 11:20:45 PM
This version should be more stable.

(http://i.imgur.com/vPv4Tfp.gif) (https://www.mediafire.com/?bo3ullo5t3f7xlw)

Download ShaderLib Beta 1.04 (https://www.mediafire.com/?bo3ullo5t3f7xlw)
Download Mirror (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.04.zip)

We also recommend Version Checker 1.4b (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.

Note: If your computer can't run ShaderLib, disable it through shaderSettings.json in the ShaderLib folder, but keep the mod enabled.


Beta 1.04 (February 16, 2015)
- Improved bloom compatibility (hopefully)
- Adjusted lighting data
- Resolved possible memory leaks
Title: Re: [0.65.2a] ShaderLib Beta 1.04
Post by: DefiasOne on February 17, 2015, 03:15:02 AM
Is shaderLib supposed to work with vanilla SS or just add functionality for modder to implement these effects? I'm not seeing the shield ripple effect or the big explosions among other things using just the vanilla game. (waiting for SS+ new version :) )

I should metion I have a HD3870 graphics card.
Title: Re: [0.65.2a] ShaderLib Beta 1.04
Post by: Tartiflette on February 17, 2015, 03:36:39 AM
Exactly two messages above your's
Ripples are mod implementation dependent, like SS+ or the Templars.
SS+ has a plugin with shield ripples and a plugin that involves ripples when a ship explodes, Templars have numerous distortions, Blackrock has several distortions, etc.  It depends on the mod, really.
Title: Re: [0.65.2a] ShaderLib Beta 1.04
Post by: DefiasOne on February 17, 2015, 03:52:33 AM
So it is mod dependant, thanks  :).                         
Title: Re: [0.65.2a] ShaderLib Beta 1.04
Post by: Karelin on February 17, 2015, 08:47:44 AM
Game crashes once startup loading is completed.
Latest version of the game and ShaderLib.

Additional mods are LazyLib and Version Checker. Game does not crash when ShaderLib is disabled.

Error is as follows:
Code
19253 [Thread-5] ERROR com.fs.starfarer.combat.O0OO  - java.lang.NoSuchMethodError: com.fs.starfarer.api.combat.CombatEngineAPI.getCustomData()Ljava/util/Map;
java.lang.NoSuchMethodError: com.fs.starfarer.api.combat.CombatEngineAPI.getCustomData()Ljava/util/Map;
at org.dark.shaders.light.LightShader.initCombat(LightShader.java:604)
at org.dark.shaders.util.ShaderHook.init(ShaderHook.java:93)
at com.fs.starfarer.title.ooOO.float$Oo.o00000(Unknown Source)
at com.fs.starfarer.combat.super.B.null(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.init(Unknown Source)
at com.fs.starfarer.title.OoOO.O??0(Unknown Source)
at com.fs.starfarer.B.null.class$super(Unknown Source)
at com.fs.super.A.new(Unknown Source)
at com.fs.starfarer.combat.O0OO.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Title: Re: [0.65.2a] ShaderLib Beta 1.04
Post by: Dark.Revenant on February 17, 2015, 09:01:32 AM
You need to update to RC2 (hotfix) of the game, which was released yesterday.
Title: Re: [0.65.2a] ShaderLib Beta 1.04
Post by: Karelin on February 17, 2015, 09:04:31 AM
You need to update to RC2 (hotfix) of the game, which was released yesterday.

Oh, didn't realize there was a new release, thanks for the heads up
Title: Re: [0.65.2a] ShaderLib Beta 1.04
Post by: Venatos on February 18, 2015, 03:31:10 AM
wow, im a spezial kind of moron.... i downloaded all the updated mods for the new version of the game and spent over an hour trying to get it to run, only to realize i didnt update the game itself! i think thats a sideeffect of steam, one gets so used to it that all games are allways automaticly up to date...
Title: [0.65.2a] ShaderLib Beta 1.05
Post by: Dark.Revenant on February 21, 2015, 02:53:02 PM
This version is especially recommended for people who wish to use Junk Pirates.

(http://i.imgur.com/vPv4Tfp.gif) (https://www.mediafire.com/?99h77t9kbo54vhq)

Download ShaderLib Beta 1.05 (https://www.mediafire.com/?99h77t9kbo54vhq)
Download Mirror (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.05.zip)

We also recommend Version Checker 1.4b (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.

Note: If your computer can't run ShaderLib, disable it through shaderSettings.json in the ShaderLib folder, but keep the mod enabled.


Beta 1.05 (February 21, 2015)
- Improved distortions compatibility (hopefully)
- Made ship skin textures fall back to base hull textures if an entry for the skin doesn't exist
Title: [0.65.2a] ShaderLib Beta 1.06
Post by: Dark.Revenant on March 13, 2015, 10:11:29 PM
This update is highly recommended.

(http://i.imgur.com/vPv4Tfp.gif) (https://www.mediafire.com/?my1v9dwmiz99229)

Download ShaderLib Beta 1.06 (https://www.mediafire.com/?my1v9dwmiz99229)
Download Mirror (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.06.zip)

We also recommend Version Checker 1.4b (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.

Warning: Make sure Starsector is GPU-Accelerated!
ShaderLib will glitch out on most integrated chips!

If your computer can't run ShaderLib, disable it through shaderSettings.json in the ShaderLib folder, but keep the mod enabled.


Beta 1.06 (March 13, 2015)
- Improved default lighting settings
- Made graphics more compliant; should have fewer glitches, especially on cards that used to have problems
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Dayshine on March 19, 2015, 06:03:28 PM
Could I suggest that the default values for StandardLight make it big/bright enough that you can actually tell it exists? :P

I just spent a while trying to debug why ShaderLib wasn't working when it was just that with the default size of 0f and the default intensity of 0f you can't see it even as a coloured light. However, it may be that I'm misusing the lights by just creating and attaching them to things!
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Dark.Revenant on March 19, 2015, 09:54:00 PM
In programming, a common assumption for initialization is that, unless otherwise specified, the initial value is zero.  If I changed it now, after already creating the interface, behavior that relied on it being zero would no longer work.

I will create a warning in the documentation that the initial values are 0, though.
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Dayshine on March 20, 2015, 04:33:56 AM
Oh I understand that, but the documentation states " A specialization of LightAPI suited for every case wherein the default, automatic lighting behaviors are sufficient.", strongly implying it would work out of the box. Also, if you're going to have default values at all they should generally be sensible, not just always zero.

Looking at other rendering libraries, the constructor includes all critical values (including intensity), avoiding this issue entirely. It seems unusual to require several step initialization for the default behaviour then not provide it :) Keep in mind you've written a library that is large and difficult to follow without any substantial documentation, so what seems obvious to you may not be to most!
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Dark.Revenant on March 20, 2015, 08:15:00 AM
Oh I understand that, but the documentation states " A specialization of LightAPI suited for every case wherein the default, automatic lighting behaviors are sufficient.", strongly implying it would work out of the box. Also, if you're going to have default values at all they should generally be sensible, not just always zero.

Looking at other rendering libraries, the constructor includes all critical values (including intensity), avoiding this issue entirely. It seems unusual to require several step initialization for the default behaviour then not provide it :) Keep in mind you've written a library that is large and difficult to follow without any substantial documentation, so what seems obvious to you may not be to most!

StandardLight wasn't originally something that I was going to publicly expose; the decision came much later down the line because I figured nobody would want to program all those little features into their own classes unless it was absolutely necessary.  The "default behaviors" being referred to are the behaviors wherein it automatically follows beams, projectiles, etc. if set to do so, similarly to a light that is created with the light data csv.  I suppose adding additional constructors with size/intensity would help, but there's no guarantee the programmer will see them.
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Xanderzoo on March 26, 2015, 09:28:31 AM
How do I set the normal map for a ship? I've created a normal map, but how do I tell ShaderLib to use it?

I've put the normal map in MyMod/graphics/normals/ships/Normalmap.png

I've also created a ship that corresponds to the normal map, but I don't know how to tell the ship to use it.
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Dark.Revenant on March 26, 2015, 11:39:33 AM
You should check a mod that uses shaderlib for how they did it.  In particular, look at the shaderlib data folder.
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Xanderzoo on March 26, 2015, 11:46:54 AM
I've checked, and I think I've figured it out. I entered information in light_data.csv and texture_data.csv, and I added the initiation code to my mod plugin. It compiled successfully, but whenever I try to run Starsector I get an error. :(

I'm trying to figure out what's causing it.
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Foxer360 on March 26, 2015, 02:14:10 PM
I've checked, and I think I've figured it out. I entered information in light_data.csv and texture_data.csv, and I added the initiation code to my mod plugin. It compiled successfully, but whenever I try to run Starsector I get an error. :(

I'm trying to figure out what's causing it.


A quick guess, did you fix your imports? Ya have to import the shaderlib classes to support the code.
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Xanderzoo on March 26, 2015, 03:10:12 PM
No, the problem was with the CSV files. I had a space where I shouldn't have.
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Eternity on May 12, 2015, 01:04:04 PM
Hi there,

I had dowload your shaderlib but I still not have any effect like distortion effect when hitting a shield  and so on...

My config...
- JRE 64
- cpu intel 4790
- 16 go ram
- nvidia 970gtx 4go (msi gaming 4g)
- win 7 64

mod is correctly selected and seems to be ok on version checker...

Any clues ? do I have to upload a log file somewhere for accurate analysis ?

Many thank in advance
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Xanderzoo on May 12, 2015, 01:18:12 PM
Shaderlib only adds functionality for ripple effects. A different mod has to add them. A popular mod that adds shield ripples is Starsector+.
Title: Re: [0.65.2a] ShaderLib Beta 1.06
Post by: Eternity on May 14, 2015, 01:43:15 AM
Thank you for the infomation :-)
Title: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on June 06, 2015, 09:00:08 PM
Now featuring post-processing capabilities and BENCHMARKS!  See OP for leaderboard.

(http://i.imgur.com/vPv4Tfp.gif) (https://www.mediafire.com/?uado15ahyrgl7ld)

Download ShaderLib Beta 1.07 (https://www.mediafire.com/?uado15ahyrgl7ld)
Download Mirror (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.07.zip)

We also recommend Version Checker (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.

Warning: Make sure Starsector is GPU-Accelerated!
ShaderLib will glitch out on older integrated chips!

If your computer can't run ShaderLib, disable it through shaderSettings.json in the ShaderLib folder, but keep the mod enabled.


Beta 1.07 (June 6, 2015)
- Added Post Processing Shader
- Added color blindness presets
- Added "enablePostProcess" and "colorBlindnessMode" options to shaderSettings.json
- Remade Benchmark mission; added SectorMarks scoring system
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Xanderzoo on June 06, 2015, 10:30:18 PM
My benchmark results:


Specs:
CPU: Intel Core i5-4440 @ 3.10GHz [4 cores]
GPU: Nvidia GeForce GT-730
RAM: 8GB DDR3 @ 1600MHz

Run length: 30.8 minutes
Average FPS: 52.4
Adjusted minimum FPS: 45.8
Average Frame Variance: 1.47ms
SectorMarks: 6693

Hopefully I did this correctly. :)

Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on June 06, 2015, 10:40:40 PM
Just curious, Xanderzoo, what are your nvidia driver settings?
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on June 06, 2015, 11:46:26 PM
FYI: I made a small update to the benchmark endpoint, which should make the results more consistent.  Redownload if you please.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Xanderzoo on June 07, 2015, 08:31:01 AM
When you say driver settings, do you mean when you right click and select NVIDIA Control Panel?
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on June 07, 2015, 11:00:31 AM
Yes, those are the driver settings.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Xanderzoo on June 07, 2015, 12:03:16 PM
Okay, here we go:

Ambient Occlusion: Off
Anisotropic filtering: 8x
Antialiasing - FXAA: Off
Antialiasing - Gamma correction: On
Antialiasing - Mode: Override any application setting
Antialiasing - Setting: 4x
Antialiasing - Transparency: Off
CUDA - GPUS: All
DSR - Factors: Off
DSR - Smoothness: Off
Maximum pre-rendered frames: Use 3D application setting
Multi-display/mixed-GPU acceleration: Multiple display performance mode
Power management mode: Adaptive
Shader cache: On
Texture filtering - Anisotropic sample optimization: Off
Texture filtering - Negative LOD bias: Clamp
Texture filtering - Quality: Quality
Texture filtering: Trilinear optimization: Off
Threaded optimization: Auto
Triple buffering: Off
Vertical sync: Use the 3D application setting
Virtual Reality pre-rendered frames: 1


Is this what you wanted?
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on June 07, 2015, 12:33:28 PM
Huh, interesting.  I had a huge boost when I set threaded optimization on (and power management to max performance).  Might just be the whole 16-concurrent-threads thing, though.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: bbarr97 on July 09, 2015, 07:36:43 PM
First off nice work with ShaderLib.  Not much time to post but noticed problems with 1.07 beta.  On 1.06 everythings seems fine so far but when using 1.07 the game leaves "ghost" images.

For example, if I select a "settings' then exit on the main menu the settings menu will not erase. 

Another example, the "vertical scan bar" the goes across the menu screen leaves the screen white behind it. 

In short, it seems that shaderlib 1.07 is not clearing the screen prior to posting the next effect.

Regards
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on July 09, 2015, 08:33:51 PM
This is due to a chipset incompatibility with the HD 3000, which I have absolutely no luck in fixing.  It probably comes down to some kind of hardware limitation of that device, preventing too many screen reads/writes in one frame or something, since I didn't change any ShaderLib features, only add an additional one that doesn't actually do anything most of the time.  This will never be resolved, since I have no other method of adding shaders to the game other than the one I am currently using.

Basically, set distortions and/or post processing to false in shaderSettings.json of the ShaderLib folder, and it will be fixed.  I'd start with post processing, since it's used a lot less than distortions.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: bbarr97 on July 10, 2015, 10:30:03 AM
This is due to a chipset incompatibility with the HD 3000, which I have absolutely no luck in fixing.  It probably comes down to some kind of hardware limitation of that device, preventing too many screen reads/writes in one frame or something, since I didn't change any ShaderLib features, only add an additional one that doesn't actually do anything most of the time.  This will never be resolved, since I have no other method of adding shaders to the game other than the one I am currently using.

Basically, set distortions and/or post processing to false in shaderSettings.json of the ShaderLib folder, and it will be fixed.  I'd start with post processing, since it's used a lot less than distortions.

Thanks for the response.   I have a GeForce 780m on my laptop and the game is set to use it instead of the integrated graphics.  Wondering if Starsector is having difficulties picking the right card?  

Also, it appeared 1.06 was working on the menu screen but in battles every time a shader effect was applied the screen would have ghosting and disappearances.  I will try some other troubleshooting and pass on if I find a fix.

FYI
Sager NP8265 Laptop
i7-4800MQ 2.7ghz
HD 4600
Geforce GTX 780M

thanks again


UPDATE

The game was having difficulty using the right video card.  It tooks several attempts after a reboot to force Starsector to use my dedicated graphics card (780M) vice the integrated. Once that happened, all worked fine.  Thanks for helping narrow the problem!
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on July 10, 2015, 06:11:54 PM
The HD 4600 supports modern graphics APIs, so I have no idea what's going wrong here.  The post processing shader only uses OpenGL 2.0.  Maybe it's due to how integrated chips handle the screen buffer?

See if this helps: http://www.mediafire.com/download/dv4ctzcs8czrkva/Shaders.jar  Replace the Shaders.jar in the jars/ folder.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Black Crag on August 20, 2015, 02:10:31 PM
Hmm, seems like i get a noticeble worse performance with the shader on, even in very small scale battles, i do not think that is is because of my graphics card since i got a gtx 970 and not because of processor because its a i5 4466. or have i too high thoughts about my pc parts?
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on August 20, 2015, 09:19:12 PM
Are you sure your graphics card is getting used?  ShaderLib is very hard on fillrate so if it's using an integrated chip, you will have performance problems.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Black Crag on August 21, 2015, 06:35:25 AM
Yea, my card is in use. but i guess that the idle percentage should be around 1-4 %? (by idle i mean the one you can see in game next to the fps counter.)
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on August 21, 2015, 08:32:17 AM
Theoretically, idle percentage (the way I'd code it) is the percentage of time the main loop is waiting between frames.  Most of this time is from the glSwapBuffers command, in theory (since it triggers vsync), but if your graphics card isn't also flushing at the same time, glSwapBuffers will be hardly any time at all, and vsync will come into effect at some other random draw command.  As a result, idle percentage is not guaranteed to be correct.  Try turning vsync off (and going fullscreen, since windowed games are always in vsync) and seeing if the "measured performance" remains low.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Black Crag on August 21, 2015, 08:49:30 AM
tried turning off v-sync on the nvidia contol panel, It didnt change my idle % at all :/
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on August 21, 2015, 08:53:24 AM
I don't know how Alex coded that part of the game, so it was just guesswork based on what I did for my own game.

Idle % is known to be inaccurate.  Did your framerate drop?
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Black Crag on August 21, 2015, 10:41:19 AM
it rarely drops with or without v-sync, it only drops is very large-scale battles.
Anyway, thanks for the help. This isnt really a big problem i was just curious if something was wrong.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: agigabyte on September 17, 2015, 02:52:58 PM
With both Shader and Lazy I'm getting this crash whenever I start up the game with them enabled. I have reinstalled both.
Spoiler
(http://i.imgur.com/z6s0yHY.png)
[close]
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on September 17, 2015, 03:19:43 PM
Re download shaderlib, it seems you have a corrupted or incomplete download.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: agigabyte on September 17, 2015, 03:30:41 PM
I did. Twice.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on September 17, 2015, 04:00:16 PM
Then obviously something is causing it to unpack incorrectly.  Go into ShaderLib/data/shaders/post and screenshot the contents.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: agigabyte on September 18, 2015, 04:09:29 PM
I don't have that.
Spoiler
(http://i.imgur.com/xrg0hmB.png)
[close]
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: Dark.Revenant on September 18, 2015, 04:15:48 PM
You are missing numerous files.  How are you unpacking it?  Is a scanner or faulty program deleting stuff?
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: agigabyte on September 18, 2015, 04:24:16 PM
Using 7Zip. Although, it works fine if Nexerelin is enabled.
Title: Re: [0.65.2a] ShaderLib Beta 1.07
Post by: agigabyte on September 18, 2015, 04:26:48 PM
OK, just reinstalled again, and I've got it.
Spoiler
(http://i.imgur.com/ITw46bS.png)
[close]
Title: [0.7a] ShaderLib Beta 1.1.0
Post by: Dark.Revenant on November 19, 2015, 10:30:18 PM
You know the drill.  Now supports all the new sprites/weapons!

(http://i.imgur.com/vPv4Tfp.gif) (https://www.mediafire.com/?m2mq8fluhf5a45y)

Download ShaderLib Beta 1.1.0 (https://www.mediafire.com/?m2mq8fluhf5a45y)
Download Mirror (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.1.0.zip)

We also recommend Version Checker (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.

Warning: Make sure Starsector is GPU-Accelerated!
ShaderLib will glitch out on older integrated chips!

If your computer can't run ShaderLib, disable it through shaderSettings.json in the ShaderLib folder, but keep the mod enabled.


Beta 1.1.0 (November 19, 2015)
- Updated texture/lighting content for Starsector 0.7a
- Updated Becnhmark metrics and scoring
- Added optimized SectorMark mission for official benchmarks
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Luna on November 20, 2015, 12:25:27 PM
That was fast.
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Dark.Revenant on November 20, 2015, 09:05:14 PM
You're either out of VRAM or out of RAM.  In the former case, you need to turn down some settings in shaderSettings.json.  In the latter case, you have to use 64 bit Java.
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Piemanlives on November 21, 2015, 03:02:54 AM
So upon loading up the new version of Shaderlib I was welcomed to the main menu with horrendous artifacts. This was to be expected and so I made all the changes to the settings that I did for the last version, however this did not fix it, however copying over my previous config file from my mod directory backup seemed to do the trick, despite having exactly the same change in settings.

I'm both curious and confused about this, maybe I missed it but did you happen to make changes to the config file? New settings or defaults that I somehow missed?
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Dark.Revenant on November 21, 2015, 12:09:01 PM
So upon loading up the new version of Shaderlib I was welcomed to the main menu with horrendous artifacts. This was to be expected and so I made all the changes to the settings that I did for the last version, however this did not fix it, however copying over my previous config file from my mod directory backup seemed to do the trick, despite having exactly the same change in settings.

I'm both curious and confused about this, maybe I missed it but did you happen to make changes to the config file? New settings or defaults that I somehow missed?

Can you upload the file you're using?  I'd like to diff it.

seems like the mod is broken right now since I am not the only one having issues lol
I cannot reproduce these problems on any computer I own.  In any case, follow the instructions here: http://fractalsoftworks.com/forum/index.php?topic=8726.0 (http://fractalsoftworks.com/forum/index.php?topic=8726.0)
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Xanderzoo on November 21, 2015, 12:14:39 PM
I just wanted to say that Shaderlib is working fine for me.
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Piemanlives on November 21, 2015, 02:50:59 PM
Can you upload the file you're using?  I'd like to diff it.

Here you go.

[attachment deleted by admin]
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: The Soldier on November 21, 2015, 03:13:41 PM
Working fine for me as well.
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Dark.Revenant on November 21, 2015, 07:17:12 PM
Can you upload the file you're using?  I'd like to diff it.

Here you go.

It seems the config file you sent me has the following options not default:
"bloomQuality":2
"bloomMips":2
"bloomScale":.5
"useLargeRipple":false

That last one is probably the main culprit, since it's a large chunk of VRAM.  Mips also matter to some degree, but not much.
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Hellya on November 27, 2015, 09:35:09 PM
How does one make Starsector GPU-Accelerated?
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Dark.Revenant on November 27, 2015, 10:04:44 PM
How does one make Starsector GPU-Accelerated?

The same way for any game.  It depends on whoever made your computer.  Most desktop systems will naturally just be GPU-only all the time.
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Luqero on November 28, 2015, 07:23:33 AM
Thanks for great mod! I was using it in previous versions of Starsector and really enjoyed additional effects :D

But i have problems with new version as it seems to not work for me. I dont see any difference vs vanilla starsector, no distortions or other effects. I tried reinstalling Starsector but it didnt changed anything. Mod is enabled, tried also using toggle/reload key, no difference :/
Im using radeon HD 5650, intel i5. Any idea why its not working would help.
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: IronBorn on November 28, 2015, 06:57:39 PM
Hi,

I get a weird graphical error when I try to use this mod.

My specs are:
Windows 10
i7 w/ an integrated Intel 5500 HD GPU
Geforce 940M Dedicated GPU

I get the following problems with this mod enabled.
1. If I launch Starsector using the integrated 5500 HD GPU, when the game loads, the screen is a bright blue and everything is washed out and barely visible.
2. If I launch using the Dedicated Geforce 940M GPU, the visuals display correctly, but I get 5 FPS (vs/ 60 FPS using the much weaker integrated GPU).

At this time, I have to set the mod to "false" to be able to use any mods that require the plugin, but I'd love to have the improved visuals. Anyone else have these problems?
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Dark.Revenant on November 28, 2015, 08:16:40 PM
Hi,

I get a weird graphical error when I try to use this mod.

My specs are:
Windows 10
i7 w/ an integrated Intel 5500 HD GPU
Geforce 940M Dedicated GPU

I get the following problems with this mod enabled.
1. If I launch Starsector using the integrated 5500 HD GPU, when the game loads, the screen is a bright blue and everything is washed out and barely visible.
2. If I launch using the Dedicated Geforce 940M GPU, the visuals display correctly, but I get 5 FPS (vs/ 60 FPS using the much weaker integrated GPU).

At this time, I have to set the mod to "false" to be able to use any mods that require the plugin, but I'd love to have the improved visuals. Anyone else have these problems?

Most of this is just me doing odd things with the graphics that underdeveloped mobile drivers don't support.  I have no way to test and no willingness to debug any of them, so you're out of luck there.  Most likely, the solution would be to rewrite the entire mod from the ground up.
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Abradolf Lincler on November 28, 2015, 08:24:31 PM
Is there a way to get those cool shield ripples SS+ has, without using SS+?
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Dark.Revenant on November 28, 2015, 08:29:59 PM
Is there a way to get those cool shield ripples SS+ has, without using SS+?

Implement them yourself?
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Abradolf Lincler on November 28, 2015, 09:03:41 PM
Is there a way to get those cool shield ripples SS+ has, without using SS+?

Implement them yourself?

How would I do that???
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: IronBorn on November 29, 2015, 01:06:26 AM
Hi,

I get a weird graphical error when I try to use this mod.

My specs are:
Windows 10
i7 w/ an integrated Intel 5500 HD GPU
Geforce 940M Dedicated GPU

I get the following problems with this mod enabled.
1. If I launch Starsector using the integrated 5500 HD GPU, when the game loads, the screen is a bright blue and everything is washed out and barely visible.
2. If I launch using the Dedicated Geforce 940M GPU, the visuals display correctly, but I get 5 FPS (vs/ 60 FPS using the much weaker integrated GPU).

At this time, I have to set the mod to "false" to be able to use any mods that require the plugin, but I'd love to have the improved visuals. Anyone else have these problems?

Most of this is just me doing odd things with the graphics that underdeveloped mobile drivers don't support.  I have no way to test and no willingness to debug any of them, so you're out of luck there.  Most likely, the solution would be to rewrite the entire mod from the ground up.

Thanks for the update. I'll just leave it off.
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: RoacH on November 29, 2015, 04:22:05 AM
java.lang.RuntimeException: Error compiling [org.dark.shaders.ShaderModPlugin]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.dark.shaders.ShaderModPlugin
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:179)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more

https://gyazo.com/3598469435334d75500e8805ff380fab

I started playing Starsector recently and found many good mods, so i started trying out, unfortunately the game crashes after the initial loading screen with ShaderLib enabled. Last lines of the log file + screenshot of the error. System: Win10/64 CPU: FX 6350 GPU: R9 390 RAM: 16GB DDR3. Am i doing something wrong/ can fix it by myself?

Its awesome to see such an modding community around such an under-the-radar game, thank you :)
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Dark.Revenant on November 29, 2015, 04:55:53 AM
java.lang.RuntimeException: Error compiling [org.dark.shaders.ShaderModPlugin]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.dark.shaders.ShaderModPlugin
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:179)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more

https://gyazo.com/3598469435334d75500e8805ff380fab

I started playing Starsector recently and found many good mods, so i started trying out, unfortunately the game crashes after the initial loading screen with ShaderLib enabled. Last lines of the log file + screenshot of the error. System: Win10/64 CPU: FX 6350 GPU: R9 390 RAM: 16GB DDR3. Am i doing something wrong/ can fix it by myself?

Its awesome to see such an modding community around such an under-the-radar game, thank you :)

The only thing that could cause that is a massively out-of-date version of Starsector, or you're missing the jar containing all of ShaderLib's scripts.  Maybe your OS/extractor/browser/antivirus deleted it?
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: RoacH on November 29, 2015, 06:31:22 AM
Thanks for the reply. My Extractor did not extract the jar sub folders. The mods i have and seem to work now are:
AutoSafe
CommonRadar
LeadingPip
Templars
LazyLib
ShaderLib

the only not working mod is citadel.
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Foxer360 on November 29, 2015, 11:42:10 AM
the only not working mod is citadel.

Make sure you download the 0.7a Citadel patch from this post only. I'm not gonna update the main thread until there is a proper release.

http://fractalsoftworks.com/forum/index.php?topic=6442.msg170372#msg170372
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: RoacH on November 30, 2015, 03:52:24 AM
the only not working mod is citadel.

Make sure you download the 0.7a Citadel patch from this post only. I'm not gonna update the main thread until there is a proper release.

http://fractalsoftworks.com/forum/index.php?topic=6442.msg170372#msg170372

Great! Many thanks again :)
Title: [0.7.1a] ShaderLib Beta 1.1.1
Post by: Dark.Revenant on November 30, 2015, 10:57:35 PM
Compatibility update, and now with asteroid maps for ring-type asteroids.

(http://i.imgur.com/vPv4Tfp.gif) (https://www.mediafire.com/?em2le283bedyej1)

Download ShaderLib Beta 1.1.1 (https://www.mediafire.com/?em2le283bedyej1)
Download Mirror (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.1.1.zip)

We also recommend Version Checker (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.

Warning: Make sure Starsector is GPU-Accelerated!
ShaderLib will glitch out on older integrated chips!

If your computer can't run ShaderLib, disable it through shaderSettings.json in the ShaderLib folder, but keep the mod enabled.


Beta 1.1.1
- Now ACTUALLY updated for Starsector 0.7a
- Added new asteroid types to lighting maps
Title: Re: [0.7.1a] ShaderLib Beta 1.1.1
Post by: SpaceRiceBowl on December 01, 2015, 12:40:42 PM
0.7.1a? Is that out yet?
Title: Re: [0.7a] ShaderLib Beta 1.1.0
Post by: Chaotic-Entropy on December 01, 2015, 04:12:24 PM
Hi,

I get a weird graphical error when I try to use this mod.

My specs are:
Windows 10
i7 w/ an integrated Intel 5500 HD GPU
Geforce 940M Dedicated GPU

I get the following problems with this mod enabled.
1. If I launch Starsector using the integrated 5500 HD GPU, when the game loads, the screen is a bright blue and everything is washed out and barely visible.
2. If I launch using the Dedicated Geforce 940M GPU, the visuals display correctly, but I get 5 FPS (vs/ 60 FPS using the much weaker integrated GPU).

At this time, I have to set the mod to "false" to be able to use any mods that require the plugin, but I'd love to have the improved visuals. Anyone else have these problems?

Hi,

I get a weird graphical error when I try to use this mod.

My specs are:
Windows 10
i7 w/ an integrated Intel 5500 HD GPU
Geforce 940M Dedicated GPU

I get the following problems with this mod enabled.
1. If I launch Starsector using the integrated 5500 HD GPU, when the game loads, the screen is a bright blue and everything is washed out and barely visible.
2. If I launch using the Dedicated Geforce 940M GPU, the visuals display correctly, but I get 5 FPS (vs/ 60 FPS using the much weaker integrated GPU).

At this time, I have to set the mod to "false" to be able to use any mods that require the plugin, but I'd love to have the improved visuals. Anyone else have these problems?

Most of this is just me doing odd things with the graphics that underdeveloped mobile drivers don't support.  I have no way to test and no willingness to debug any of them, so you're out of luck there.  Most likely, the solution would be to rewrite the entire mod from the ground up.

FYI both, I think you can fix this by simply adding Jave.exe as high performance in your switchable graphics settings as well as Starsector. I'm pretty sure it worked for my AMD laptop switchable graphics.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.1
Post by: Umbra Eterna on December 01, 2015, 04:18:31 PM
I'm having a similar problem as with IronBorn. My GPU on my PC (I have a desktop not a laptop) is a GTS 450 and the previous patch for ShaderLib didn't tank my FPS. Now I average around 16 FPS and always have a high idle percentage (I don't think your mod is the cause, but it could influence it).
Title: Re: [0.7.1a] ShaderLib Beta 1.1.1
Post by: NightfallGemini on December 07, 2015, 02:10:05 AM
I have no idea why this is happening, but the game dumps framerate when certain effects (for example, the Templar Rhon Laser) occur even off screen. My hardware is far beyond spec (FX8350, 2 way SLI GTX760OC) so I have no clue what's causing this. I remember it went away on its own a while back, but it's now consistently around every time. It only happens in campaign mode, both on the 'overworld' and battles.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.1
Post by: Dark.Revenant on December 07, 2015, 02:18:34 AM
The two things that come to mind are vsync and drivers.  I've tried it with a GTX 670 and GTX 980Ti without issue, and other people I know have used cards in the 7xx range, so a GTX 760 doesn't have inherent problems.  On the GTX 980Ti, my GPU usage is approximately 17% while the Templar anamorphic shader (Rhon, etc.) is active, and 10% without (looking at just a single ship with nothing else going on).  It's not exactly a trivial thing to run, but unless your GPU usage is very high to begin with, it shouldn't matter.

What frame rate do you have before and during the shader?  What about GPU usage?  Does turning off the game's vsync (data/config/settings.json) affect it?  Does turning off SLI affect it?
Title: Re: [0.7.1a] ShaderLib Beta 1.1.1
Post by: NightfallGemini on December 07, 2015, 02:49:40 AM
While using Shaderlib, vsync off, on the map screen I seem to be averaging 44FPS, GPU utilization at 63% on card one, 3% on card two (I'm assuming this means it's not fully utilizing SLI :V).

The combat issue comes and goes, and I don't see an FPS counter on the combat screen. With vsync off it seems to be smooth but has slight tears/jerkiness from time to time (come to think of it, I'm going to guess the tearing is due to SLI. It's happened in more intensive stuff like Fallout 4 before too). It was having that lag when vsync was on though.

Also, I haven't noticed any significant difference with SLI on or off.

E: Oh, also, I wasn't able to catch it last combat, but on the title screen I have the same average utilization. I'm assuming that's an okay metric considering it's one big combat map, but I can check in an actual fight too if you like.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.1
Post by: Dark.Revenant on December 07, 2015, 02:57:18 AM
While using Shaderlib, vsync off, on the map screen I seem to be averaging 44FPS, GPU utilization at 63% on card one, 3% on card two (I'm assuming this means it's not fully utilizing SLI :V).

The combat issue comes and goes, and I don't see an FPS counter on the combat screen. With vsync off it seems to be smooth but has slight tears/jerkiness from time to time. It was having that lag when vsync was on though.

Also, I haven't noticed any significant difference with SLI on or off.

Starsector can't and won't use SLI.

Combat FPS are in dark grey on the bottom-center of the combat screen.  Slight tears/jerkiness is expected performance in Starsector, currently, if you're above 50% machine utilization.

The way vsync works is that it bins the game to certain frame rates, depending on your monitor's refresh rate.  For a 60 Hz monitor, these are 60, 30, 20, 15, 12, 10, etc.  These integral ratios allow it to match exactly your refresh period, or a multiple of it.  If the driver notices that the frame took too long, it will cause the next frame to wait long enough to reach the 1/30-second refresh period, etc.  As a result, once you start to reach your card's maximum output, it will suddenly drop your frame rate to 30 to ensure that you don't get tearing and that you're synced to twice your monitor's refresh period.  The downside of this is that you can end up having a huge performance hit; you might have been able to otherwise pull 55 FPS, but vsync would still drop you to 30 FPS.

Turning vsync off has its pros and cons.  You can also adjust shader settings accordingly, either globally (shaderSettings.json) or in the particular mod's settings that apply.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.1
Post by: NightfallGemini on December 07, 2015, 03:18:06 AM
I'm not really sure how, but turning vsync off, running the game for a bit and then reopening it with vsync on seemed to have fixed the issue for now. If I remember, I had to do something similar before, too but it'd always come back after a while.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.1
Post by: Dark.Revenant on December 08, 2015, 05:56:45 PM
That's certainly odd, because ShaderLib basically didn't change between updates.  Only things I can think of are that Starsector's code changed in some significant manner, Java 8 caused problems, or Alex replaced LWJGL with a less-optimized version for some reason.

Try using the 0.65.2a version of shaderlib with 0.7.1a and see if that improves performance.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.1
Post by: Dark.Revenant on December 08, 2015, 06:52:49 PM
I'd bet anything that simply using the Java 8 standard for the current build is at fault.  Would you be willing to run a few test builds?
Title: Re: [0.7.1a] ShaderLib Beta 1.1.1
Post by: Bobakanoosh on December 08, 2015, 11:01:10 PM
I seem to be having similar issues to the above posters as well. Running the game+lazylib+shaderlib has my main menu running at 7 FPS with 103% idle. My laptop is running windows 8.1 and has an i7-4720HQ CPU, 16 GB RAM, and a GTX 970M. I've edited vmparams with xms4096m/xmx4096m, as well as taken the steps of replacing Starsector's jre folder. In addition, sometimes when I run the game (i've only gotten as far as the menu), the graphics suddenly becomes extremely over-saturated.
Title: [0.7.1a] ShaderLib Beta 1.1.2
Post by: Dark.Revenant on December 08, 2015, 11:26:16 PM
So.  Uh.  I found out what the problem was.

Turns out, I left my personal settings in the 1.1.1 upload.  The ones I use on a GTX 980 Ti.  Yeah.

The good news is, I found a thing that was causing a significant performance bottleneck.  Total ShaderLib CPU overhead (performance loss from vanilla Starsector) in heavy battles reduced from 30% to 12%, which is about a 2.5x performance improvement, at least for the lighting engine.  I also added an option that should further improve performance on low-end graphics cards.

(http://i.imgur.com/vPv4Tfp.gif) (https://www.mediafire.com/?scnb7n85tckngx7)

Download ShaderLib Beta 1.1.2 (https://www.mediafire.com/?scnb7n85tckngx7)
Download Mirror (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.1.2.zip)

We also recommend Version Checker (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.

Warning: Make sure Starsector is GPU-Accelerated!
ShaderLib will glitch out on older integrated chips!

If your computer can't run ShaderLib, disable it through shaderSettings.json in the ShaderLib folder, but keep the mod enabled.


Beta 1.1.2
- Significantly reduced ShaderLib CPU usage
- Added "extraScreenClear" option to shaderSettings.json (set to false to reduce fill rate)
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: AeusDeif on December 09, 2015, 03:20:33 AM
'ShaderLib Beta 1.1.2 is malicious, and Chrome has blocked it.'

the mirror worked though.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: Bastion.Systems on December 09, 2015, 03:26:04 AM
Firefox on the other hand does not seem to mind.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: sycspysycspy on December 09, 2015, 04:21:30 AM
'ShaderLib Beta 1.1.2 is malicious, and Chrome has blocked it.'

the mirror worked though.
Same here
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: AeusDeif on December 09, 2015, 06:08:31 AM
I guess firefox just isn't advanced enough to protect us from these fiendish hackers pretending to be starsector modders (sarcasm)
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: Dark.Revenant on December 09, 2015, 02:48:17 PM
You are not missing much at the moment.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: OOZ662 on December 11, 2015, 11:16:44 AM
For what it's worth, having PP on destroys my framerate to slideshow levels too, but since I'm using a 9300M GS I never exactly expect high performance.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: Barracuda on December 13, 2015, 04:51:38 AM
ARGH! Its mods like these in games that make me mad I got a new computer... My last computer could run it but not this one. It really is an amazing mod keep up the good work.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: cqsolace on December 13, 2015, 01:39:08 PM
My Dell XPS-13 (Intel HD Graphics 5500) has serious graphical issues when ShaderLib Post-Processing is enabled. Artifacts, ghosting, and incorrect colors. Drivers are fully up to date. When post-processing is disabled, there are no issues. Let me know if you need more specific info (and what kind).
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: Dark.Revenant on December 13, 2015, 04:41:41 PM
I have no idea.  The post processing shader is technically the simplest one in the mod.  Probably some random incompatibility; without having your computer on hand in my house, it would be essentially impossible to debug.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: nomadic_leader on February 09, 2016, 08:50:34 PM
Hello, this is a perhaps foolish question for Dark Revenant and/or xenoargh.

Can ShaderLib provide persistent directional lighting (as if from a sun) so that when the ship sprites rotate, the shadows change because of the normal maps? I guess it would look really cool with ships where the normals define broad, angled volumes like the Mayorate's 3d rendered ships.

Like in this pic here:

Spoiler
(http://i.imgur.com/YQBSt3d.png)
[close]

Just takes a bit of tweaking, honestly.

Is there a shaderlib setting or additional mod to download that will enable this?

If there isn't anything existing, I'll only say it would be nifty if there were a mod that used shaderlib and each time combat began, it would calculate the direction of the nearest sun or the nearest star system if you were in hyperspace, and then apply a persistent directional light from that direction to all ships on the battlefield.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: Dark.Revenant on February 09, 2016, 11:38:51 PM
Starsector+ already does this.

ShaderLib, by the way, supports point, line, cone, and directional lights.
Title: Re: [0.7.1a] ShaderLib Beta 1.1.2 (Performance Fix!)
Post by: nomadic_leader on February 10, 2016, 03:43:48 PM
Starsector+ already does this.

ShaderLib, by the way, supports point, line, cone, and directional lights.

Thank you, I'll try it.
Title: [0.7.2a] ShaderLib Beta 1.2.0
Post by: Dark.Revenant on February 26, 2016, 07:31:26 PM
Routine update, packed with updated content from vanilla.  Also, included are default settings files you can use depending on how powerful (or wimpy) your computer is.

(http://i.imgur.com/vPv4Tfp.gif) (https://www.mediafire.com/?53jxqmgjs95o527)

Download ShaderLib Beta 1.2.0 (https://www.mediafire.com/?53jxqmgjs95o527)
Download Mirror (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.2.0.7z)

We also recommend Version Checker (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.

Warning: Make sure Starsector is GPU-Accelerated!
ShaderLib will glitch out on older integrated chips!

If your computer can't run ShaderLib, disable it through shaderSettings.json in the ShaderLib folder, but keep the mod enabled.


Beta 1.2.0
- Updated for Starsector 0.7.2a
- Weapon cover maps supported
- Option defaults improved for users with incompatible hardware
- Benchmark mission improved
Title: Re: [0.7.2a] ShaderLib Beta 1.2.0
Post by: Ahne on February 27, 2016, 07:04:57 AM
Great stuff, DR, good work!
Title: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dark.Revenant on February 28, 2016, 02:11:05 PM
Fixed some glitches and crashes relating to weapon covers.

(http://i.imgur.com/vPv4Tfp.gif) (https://www.mediafire.com/?aex71w33te57l2d)

Download ShaderLib Beta 1.2.1b (https://www.mediafire.com/?aex71w33te57l2d)
Download Mirror (http://www.sc2mafia.com/Starsector/ShaderLib%20Beta%201.2.1b.7z)

We also recommend Version Checker (http://fractalsoftworks.com/forum/index.php?topic=8181) to notify you when an update is ready.

Warning: Make sure Starsector is GPU-Accelerated!
ShaderLib will glitch out on older integrated chips!

If your computer can't run ShaderLib, disable it through shaderSettings.json in the ShaderLib folder, but keep the mod enabled.


Beta 1.2.1b
- Fixed cover-related glitches and crashes
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1
Post by: LB on February 29, 2016, 09:18:44 PM
Spotted infrequently, most recently in Duel of the Century:

Code
141622 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.settings.B.getTextureId(Unknown Source)
at org.dark.shaders.util.ShaderLib.renderForeground(ShaderLib.java:1098)
at org.dark.shaders.util.ShaderLib.isForegroundEmpty(ShaderLib.java:634)
at org.dark.shaders.light.LightShader.drawLights(LightShader.java:948)
at org.dark.shaders.light.LightShader.renderInWorldCoords(LightShader.java:943)
at org.dark.shaders.util.ShaderHook.renderInWorldCoords(ShaderHook.java:135)
at com.fs.starfarer.title.C.o0oO$Oo.?00000(Unknown Source)
at com.fs.starfarer.combat.A.new.?00000(Unknown Source)
at com.fs.starfarer.combat.CombatState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Maybe today's the day everything I knew about short-circuits gets overturned.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1
Post by: Dark.Revenant on February 29, 2016, 10:10:05 PM
Spotted infrequently, most recently in Duel of the Century:

Code
141622 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.settings.B.getTextureId(Unknown Source)
at org.dark.shaders.util.ShaderLib.renderForeground(ShaderLib.java:1098)
at org.dark.shaders.util.ShaderLib.isForegroundEmpty(ShaderLib.java:634)
at org.dark.shaders.light.LightShader.drawLights(LightShader.java:948)
at org.dark.shaders.light.LightShader.renderInWorldCoords(LightShader.java:943)
at org.dark.shaders.util.ShaderHook.renderInWorldCoords(ShaderHook.java:135)
at com.fs.starfarer.title.C.o0oO$Oo.?00000(Unknown Source)
at com.fs.starfarer.combat.A.new.?00000(Unknown Source)
at com.fs.starfarer.combat.CombatState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Maybe today's the day everything I knew about short-circuits gets overturned.

What the ***?  That has to be a bug on Alex's end.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1
Post by: Kyuss11 on March 01, 2016, 04:28:17 PM
I'm having issues with shaderlib 1.2.1
I updated to .072a starsector and lazylib as well as the new one of shaderlib.
When I try to load starsector+ I get a error after loading.
When I just load shaderlib the game will work except the ships graphic is not there but a trail of lines of the ship.
I have the java runtime and allocated 4gb of ram and I had no issues running the 12 mods before so just to let you know I thought I knew what I was doing.
Is shaderlib broke for now?
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1
Post by: Dark.Revenant on March 01, 2016, 08:07:21 PM
I'm having issues with shaderlib 1.2.1
I updated to .072a starsector and lazylib as well as the new one of shaderlib.
When I try to load starsector+ I get a error after loading.
When I just load shaderlib the game will work except the ships graphic is not there but a trail of lines of the ship.
I have the java runtime and allocated 4gb of ram and I had no issues running the 12 mods before so just to let you know I thought I knew what I was doing.
Is shaderlib broke for now?

No idea, man.  Maybe you could try forcing the Nvidia card to be used for Java.exe and Starsector.exe, and update drivers?
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dark.Revenant on March 01, 2016, 09:15:13 PM
PSA: Updated with hotfix for default settings.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Surge on March 01, 2016, 10:54:32 PM
Having an issue, I have a GTX 560 Ti, so about 1024MB of video memory, theoretically I'm on recommended settings, but if I start up SS with shaderlib and all the up to date mods enabled my FPS will tank to 7 on the menu and in combat, and minimizing the game to inspect it's system resource usage through the task manager will prompt it to start leaking memory until it overflows and crashes, I had 3-5G of memory allocated previously but I'm gonna try and up it to 4-6G.
Will report on results.
edit: neg, ineffectual
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dark.Revenant on March 01, 2016, 11:25:19 PM
Sounds like a very poor driver, a very poor mod you've installed somewhere, or a seriously busted version of Java.  Absolutely DO NOT allocate more memory.

ShaderLib does not allocate much heap memory. VRAM is another matter, and overflowing there can start to eat into RAM, but that's usually handled by the driver and doesn't show up on Task Manager.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Surge on March 01, 2016, 11:34:03 PM
Poor driver could sum up my entire experience with this card, but there does seem to be an update for it, I'll allocate LESS memory, update the driver, and see how it runs then, I don't think it's any of the mods since it's all standard stuff, SS+, II, BRDY, Scy, DA, common radar, save transfer, console commands, neutrino, and the various requisite -libs.

edit: who'da thunk it, drivers were the culprit.
edit2: not out of the woods yet, I started the game 3 times, on the second boot the game's FPS capped at 3, third boot it went into in to the 30s UNTIL a ship drifted across the back of the menu, which caused it to tank to 7. After killing the program both times JRE hangs up and doesn't respond to task manager while eating a lion's share of system memory, it's just the x64 version of jre7u80 though so I don't see why.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dark.Revenant on March 02, 2016, 12:19:53 AM
Poor driver could sum up my entire experience with this card, but there does seem to be an update for it, I'll allocate LESS memory, update the driver, and see how it runs then, I don't think it's any of the mods since it's all standard stuff, SS+, II, BRDY, Scy, DA, common radar, save transfer, console commands, neutrino, and the various requisite -libs.

edit: who'da thunk it, drivers were the culprit.
edit2: not out of the woods yet, I started the game 3 times, on the second boot the game's FPS capped at 3, third boot it went into in to the 30s UNTIL a ship drifted across the back of the menu, which caused it to tank to 7. After killing the program both times JRE hangs up and doesn't respond to task manager while eating a lion's share of system memory, it's just the x64 version of jre7u80 though so I don't see why.

You should probably update your shaderLib settings.  The lighting shader actually doesn't run (iirc) unless an object is in view, so it's probably being triggered by the shader code.

Considering that ShaderLib runs fine for me, that rules out a programming error; my best guess is some setting is going past your card's limits.  Redownload ShaderLib; the defaults were changed.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Surge on March 02, 2016, 12:50:02 AM
The problem is that I can't replicate any of these problems consistently, I was about to say that it's being caused by SS+, because I disabled SS+ and it worked fine, but then I tried to boot it again with SS+ still disabled and the resource usage maxed and tanked the framerate again, I've tried switching jre versions from 7u80 to 7u79 and even tried it with an x86 version of jre7, the only thing I can replicate is that all of these problems go away when I disable shaderlib.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: OOZ662 on March 02, 2016, 01:04:06 AM
That's exactly why you should change ShaderLib settings. Start flicking some trues to falses and see if one makes the problem go away.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Surge on March 02, 2016, 01:05:49 AM
I've set "enableLights" to false which seems to have about halved resource usage, not sure why it was eating up half of my system resources though.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Kyuss11 on March 02, 2016, 06:58:34 AM
Ok,my issue is fixed
Quote
I was wondering if anyone knew how to fix this,it only happens during combat.http://imgur.com/ru98oJd
I've updated everything and it all worked on .7.1
I'm not sure if there is some setting in shaderlib I could adjust?

It appears that my card needed to run true on:
"use64BitBuffer":true # Default: true
        # This causes various usages of the auxiliary texture buffer to be more accurate, but is unsupported by older cards and uses more GPU memory
        # If you are getting strangely bad performance, try turning this off
        # This option uses 5 MB - 21 MB of VRAM, depending on screen resolution
I know I have a high-end gpu so I'm guessing that it needs all the texture buffer to be enabled since my nvidia control panel has several global and defualt settings for high performance.
Thank You for your time on this mod.Hopefully everyone else can find a fix as well.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dark.Revenant on March 02, 2016, 01:13:14 PM
Ok,my issue is fixed
Quote
I was wondering if anyone knew how to fix this,it only happens during combat.http://imgur.com/ru98oJd
I've updated everything and it all worked on .7.1
I'm not sure if there is some setting in shaderlib I could adjust?

It appears that my card needed to run true on:
"use64BitBuffer":true # Default: true
        # This causes various usages of the auxiliary texture buffer to be more accurate, but is unsupported by older cards and uses more GPU memory
        # If you are getting strangely bad performance, try turning this off
        # This option uses 5 MB - 21 MB of VRAM, depending on screen resolution
I know I have a high-end gpu so I'm guessing that it needs all the texture buffer to be enabled since my nvidia control panel has several global and defualt settings for high performance.
Thank You for your time on this mod.Hopefully everyone else can find a fix as well.

That's, uh, really weird.  I had no idea turning that on could fix problems.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1
Post by: johnbob69 on March 08, 2016, 08:14:19 AM
Spotted infrequently, most recently in Duel of the Century:

Code
141622 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.settings.B.getTextureId(Unknown Source)
at org.dark.shaders.util.ShaderLib.renderForeground(ShaderLib.java:1098)
at org.dark.shaders.util.ShaderLib.isForegroundEmpty(ShaderLib.java:634)
at org.dark.shaders.light.LightShader.drawLights(LightShader.java:948)
at org.dark.shaders.light.LightShader.renderInWorldCoords(LightShader.java:943)
at org.dark.shaders.util.ShaderHook.renderInWorldCoords(ShaderHook.java:135)
at com.fs.starfarer.title.C.o0oO$Oo.?00000(Unknown Source)
at com.fs.starfarer.combat.A.new.?00000(Unknown Source)
at com.fs.starfarer.combat.CombatState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Maybe today's the day everything I knew about short-circuits gets overturned.

What the ***?  That has to be a bug on Alex's end.

Im recieving this very error in the campaign mode. It occurs whenever i hit the deploy button.

Used both the default and deluxe settings with the same results:

75182 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at com.fs.starfarer.settings.B.getTextureId(Unknown Source)
   at org.dark.shaders.util.ShaderLib.renderForeground(ShaderLib.java:1098)
   at org.dark.shaders.util.ShaderLib.isForegroundEmpty(ShaderLib.java:634)
   at org.dark.shaders.light.LightShader.drawLights(LightShader.java:948)
   at org.dark.shaders.light.LightShader.renderInWorldCoords(LightShader.java:943)
   at org.dark.shaders.util.ShaderHook.renderInWorldCoords(ShaderHook.java:135)
   at com.fs.starfarer.title.C.o0oO$Oo.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.A.new.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.CombatState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dark.Revenant on March 08, 2016, 08:45:32 AM
Maybe you could try updating Starsector.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: johnbob69 on March 08, 2016, 08:48:17 AM
Maybe you could try updating Starsector.

Im running the latest build, i guess i will try a fresh install.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dark.Revenant on March 08, 2016, 08:50:38 AM
Maybe you could try updating Starsector.

Im running the latest build, i guess i will try a fresh install.

It would also help if you told me what all your mods are, and their versions.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: johnbob69 on March 08, 2016, 09:12:49 AM
Maybe you could try updating Starsector.

Im running the latest build, i guess i will try a fresh install.

It would also help if you told me what all your mods are, and their versions.

A fresh install seems to have sorted the issue.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Timpe on March 14, 2016, 08:19:18 AM
I seem to have this issue where setting enableLights to true makes my CPU idle instantly go to 1% even in the test map with just the two ships doing nothing. My idle without Shaderlib is 50-80% usually.

Starsector version is 7.2a, Shaderlib is 1.2.1b, CPU is i5 2500k, GPU is GTX770 4GB. Any help would be appreciated.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dark.Revenant on March 14, 2016, 08:46:21 AM
That's normal behavior.  Idle % is not entirely accurate; your actual CPU usage isn't actually skyrocketing.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Timpe on March 14, 2016, 11:07:58 AM
That's good to know. Thanks.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dudley Dickerson on March 15, 2016, 10:58:37 AM
How do I know if the game is GPU accelerated? I get massive frame rate drops despite my system being more than capable of never getting any drops.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dark.Revenant on March 15, 2016, 01:58:46 PM
That would be an indicator. You can also check GPU usage; if it's like 0-5% in a big battle, something is wrong.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dudley Dickerson on March 15, 2016, 02:07:46 PM
That would be an indicator. You can also check GPU usage; if it's like 0-5% in a big battle, something is wrong.

The usage fluctuates rapidly in combat so I guess it's being used.
I just can't figure out why my framerate in combat is so bad, at worst it drops below 20. A 2500k at 4.5 and 8 gigs of RAM (with 64bit Java) should be plenty, right?

Edit:
I've done some research and I think it might have something to do with AMDs OpenGL drivers.
Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dimaris on March 30, 2016, 03:28:48 AM
http://fractalsoftworks.com/forum/index.php?topic=10923.0
just leave it here.  :)

( Error associated with the # LIGHT OPTIONS # from the ShaderLib )
Code
 130766 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.settings.B.getTextureId(Unknown Source)
at org.dark.shaders.light.LightShader.drawNormalMaps(LightShader.java:1711)
at org.dark.shaders.light.LightShader.drawLights(LightShader.java:957)
at org.dark.shaders.light.LightShader.renderInWorldCoords(LightShader.java:943)
at org.dark.shaders.util.ShaderHook.renderInWorldCoords(ShaderHook.java:135)
at com.fs.starfarer.title.C.o0oO$Oo.?00000(Unknown Source)
at com.fs.starfarer.combat.A.new.?00000(Unknown Source)
at com.fs.starfarer.combat.CombatState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Title: Re: [0.7.2a] ShaderLib Beta 1.2.1b
Post by: Dark.Revenant on March 30, 2016, 12:52:00 PM
Incompatible mods cause that problem, not ShaderLib.  I'm the one who has to jump through hoops and reduce ShaderLib performance to fix someone else's problem.  That said, update coming soon.

Edit: Update I decided to post in another thread: http://fractalsoftworks.com/forum/index.php?topic=10931.0
It's a big troubleshooting section!
Title: [0.7.2a] ShaderLib Beta 1.2.1b (Legacy)
Post by: Dark.Revenant on April 15, 2016, 12:12:32 AM
NOTICE: This mod is outdated! Click HERE (http://fractalsoftworks.com/forum/index.php?topic=10982) for GraphicsLib.