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 2 3 [4] 5 6 ... 27

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

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2744
    • View Profile
    • Sc2Mafia
    • Email
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #45 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.
Logged

xenoargh

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

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2744
    • View Profile
    • Sc2Mafia
    • Email
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #47 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.
Logged

xenoargh

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

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2744
    • View Profile
    • Sc2Mafia
    • Email
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #49 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.
Logged

xenoargh

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

xenoargh

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

Debido

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

Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2744
    • View Profile
    • Sc2Mafia
    • Email
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #53 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.
Logged

xenoargh

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

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2744
    • View Profile
    • Sc2Mafia
    • Email
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #55 on: May 16, 2014, 07:31:12 PM »

Try manually casting it?  You might not have the correct classes imported in the header either.
Logged

xenoargh

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

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2744
    • View Profile
    • Sc2Mafia
    • Email
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #57 on: May 16, 2014, 08:02:48 PM »

Can you give the full, verbose compiler error?
Logged

xenoargh

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

xenoargh

  • Admiral
  • *****
  • Posts: 4934
  • naively breaking things!
    • View Profile
Re: [Graphics] Dynamic Lights for Starsector! (ShaderLib Alpha v1.05)
« Reply #59 on: May 16, 2014, 08:50:30 PM »

Still red-flagged, but it's still working.  Testing out addLight now...
Logged
Please check out my SS projects :)
Xeno's Mod Pack
Pages: 1 2 3 [4] 5 6 ... 27