Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95.1a is out! (12/10/21); Blog post: Hyperspace Topography (10/12/22)

Pages: 1 ... 3 4 [5] 6 7 ... 27

Author Topic: [0.7.2a] ShaderLib Beta 1.2.1b (Legacy)  (Read 229478 times)

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2745
    • View Profile
    • Sc2Mafia
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #60 on: May 16, 2014, 09:11:28 PM »

You have tried restarting NetBeans, right?
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1355
    • View Profile
    • GitHub Profile
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #61 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.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 4934
  • naively breaking things!
    • View Profile
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #62 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.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2745
    • View Profile
    • Sc2Mafia
Re: [Graphics] ShaderLib Graphics Enhancement Mod (Alpha v1.05)
« Reply #63 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.
« Last Edit: May 16, 2014, 11:41:22 PM by Dark.Revenant »
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2745
    • View Profile
    • Sc2Mafia

Update!

ShaderLib Alpha v1.1

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
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2745
    • View Profile
    • Sc2Mafia

Quick update!

ShaderLib Alpha v1.11

Alpha v1.11 (May 17, 2014)
- getArcStart and getArcEnd added to DistortionAPI (allows only a certain subset of the direction vectors to apply)
« Last Edit: May 17, 2014, 11:38:58 AM by Dark.Revenant »
Logged

theSONY

  • Admiral
  • *****
  • Posts: 673
  • Not a single Flux given
    • View Profile
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #66 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
Logged
-the ABOMINATION - in progress

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2745
    • View Profile
    • Sc2Mafia

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.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 4934
  • naively breaking things!
    • View Profile

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 :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 4934
  • naively breaking things!
    • View Profile

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.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 4934
  • naively breaking things!
    • View Profile

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?
Logged
Please check out my SS projects :)
Xeno's Mod Pack

theSONY

  • Admiral
  • *****
  • Posts: 673
  • Not a single Flux given
    • View Profile

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 :)
Logged
-the ABOMINATION - in progress

xenoargh

  • Admiral
  • *****
  • Posts: 4934
  • naively breaking things!
    • View Profile

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 :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

ValkyriaL

  • Admiral
  • *****
  • Posts: 2145
  • The Guru of Capital Ships.
    • View Profile

or you could just change the weapon light radius in the light.csv. :o
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2745
    • View Profile
    • Sc2Mafia

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.
Logged
Pages: 1 ... 3 4 [5] 6 7 ... 27