Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Poll

On a scale of 1 to 5, how do you feel about having 3D/Normal mapped ships as shown. One being like, 3 being in between an 5 being complete dislike for it.

1. I love it it makes the game more engrossing!
- 13 (14.1%)
2. It's good and helps add to the ship aesthetic
- 20 (21.7%)
3. It's satisfactory, I like both the original and the 3d version
- 28 (30.4%)
4. I dislike it - it ruins the aesthetic created by David
- 28 (30.4%)
5. It's horrible! It ruins the game! Don't you dare add this!
- 3 (3.3%)

Total Members Voted: 92


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

Author Topic: '3D' Starsector Ship - Does this look good or bad? Vote Now!  (Read 38971 times)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #60 on: July 05, 2014, 04:30:14 PM »

Hrmm.  Still no result here at all with this:

Code
                //Create the new light
                StandardLight sunLight = new StandardLight();
                sunLight.setColor(255f,255f,255f);
                sunLight.setType(3);
                Vector3f dir = new Vector3f(-0.57735f, -0.57735f, -0.57735f);
                sunLight.makePermanent();
                sunLight.setDirection(dir);
                sunLight.setIntensity(10f);
                sunLight.setSpecularIntensity(10f);
                LightShader.addLight(sunLight);   

Going to check over everything else:

In settings.json:

Code
		"shipMaterial":{
"glaug_swimmer":"graphics/shaders/material/ships/glaug_swimmer.png",
},
"shipNormal":{
"glaug_swimmer":"graphics/shaders/normal/ships/glaug_swimmer.png",
},

In core_texture_data.csv:

Code
glaug_swimmer,ship,,material,shipMaterial,glaug_swimmer
glaug_swimmer,ship,,normal,shipNormal,glaug_swimmer

So... the only thing I could see being the problem here is the shader or something's wrong with the light setup.  I'll try messing with the shader to confirm that the normalmap is present, etc.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #61 on: July 05, 2014, 04:51:39 PM »

OK, changed the shader's last two lines to:

Code
		color = norm;
gl_FragColor = vec4(color, 1.0);

Got this, only when one of the other light events is firing (weapons / vernier thrusters):



If you can't tell, that's an almost-but-not-truly-black ship-shape.  Weird.

So...

1.  The permanent distant light isn't working at all atm, otherwise we'd see this all the time.  Which isn't making sense.

The code used is here...

Spoiler
Code: java
package data.scripts.plugins;

import java.util.List;

import org.lwjgl.util.vector.Vector2f;

import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.CollisionClass;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipHullSpecAPI;
import com.fs.starfarer.api.combat.WeaponAPI;

import java.awt.Color;
import java.util.HashMap;
import java.util.Map;
import org.dark.shaders.light.LightAPI;
import org.dark.shaders.light.LightShader;
import org.dark.shaders.light.StandardLight;
import org.lwjgl.util.vector.Vector3f;


public class ShipPhysics implements EveryFrameCombatPlugin {

private CombatEngineAPI engine;
        private float height;
        private float width;
        private boolean doneOnce = false;
        
        public static Map darkMap = new HashMap();

        @Override
public void init(CombatEngineAPI engine) {
this.engine = engine;
                this.height = engine.getMapHeight() / 2f;
                this.width = engine.getMapWidth() / 2f;
}

        @Override
public void advance(float amount, List events)
{
            if (engine.isPaused()) return;

            if(!doneOnce){
                //Create the new light
                StandardLight sunLight = new StandardLight();
                sunLight.setColor(255f,255f,255f);
                sunLight.setType(3);
                Vector3f dir = new Vector3f(-0.57735f, -0.57735f, -0.57735f);
                sunLight.makePermanent();
                sunLight.setDirection(dir);
                sunLight.setIntensity(10f);
                sunLight.setSpecularIntensity(10f);
                LightShader.addLight(sunLight);                  
                doneOnce = true;
            }
            //Gets all ships;
            for (ShipAPI ship : engine.getShips()){
                if(!darkMap.containsKey(ship)){
                    ship.getSpriteAPI().setColor(new Color(32,32,32,255));
                    for(WeaponAPI weapon : ship.getAllWeapons()){
                        if(!weapon.getSlot().isHardpoint() && !weapon.getSlot().isDecorative() && !weapon.getSlot().isSystemSlot()){
                            weapon.getSprite().setColor(new Color(32,32,32,255));
                        }
                    }
                    darkMap.put(ship,ship);
                }
            }
}
}
[close]

2.  The results don't make sense.  I should be seeing the normal map or pure black; instead, I'm seeing almost-black gray.  

Any ideas?  I don't suppose you're using additive blending here or something like that?
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #62 on: July 05, 2014, 07:03:06 PM »

Well, two things.  First of all, you still messed up the color by setting it to 255f,255f,255f because that's out of range.  It has to be 255,255,255 or 1f,1f,1f if you want pure white.

Second, you need to initialize the texture data; otherwise the game will substitute a dark color in place of a normal map to signify that it does not have a normal map.  I forgot to put this on the OP of the shaderlib thread:
Code: java
        TextureData.readTextureDataCSV("data/lights/YOUR_TEXTURE_DATA.csv");  
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #63 on: July 06, 2014, 02:54:59 PM »

Ohhhhh.  Yeah, makes sense, will fix that.  But what about the light not activating at all?
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #64 on: July 06, 2014, 03:04:08 PM »

OK, corrected that.  Now when any other StandardLight is running, I get this:



I presume that's the normalmap after bloom?

But I still don't have a permanent light.  Would setting the directional light's location to the center of the screen be necessary, to avoid it being culled?

I'll try that out, see what happens.  Strange that that part doesn't work thus far.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #65 on: July 06, 2014, 03:09:04 PM »

That didn't work:

Code
            if(!doneOnce){
                //Create the new light
                sunLight.setColor(255,255,255);
                sunLight.setType(3);
                Vector3f dir = new Vector3f(-0.57735f, -0.57735f, -0.57735f);
                sunLight.makePermanent();
                sunLight.setDirection(dir);
                sunLight.setIntensity(10f);
                sunLight.setSpecularIntensity(10f);
                LightShader.addLight(sunLight);                   
                doneOnce = true;
            }   
            sunLight.setLocation(engine.getViewport().getCenter());

Will try once-per-frame.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #66 on: July 06, 2014, 04:33:03 PM »

You might want to revert the shader to what you have before so it doesn't look so weird.

Also, non-permanent lights last an entire minute before automatically disappearing.  Unless you reload the shader, which makes them instantly vanish.

Also that intensity is crazy high; try 0.1 and 1 for intensity and specular intensity.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #67 on: July 06, 2014, 07:45:18 PM »

OK... got it working-ish; need to instantiate the light during Init().

But we're definitely seeing a problem with directional falloff; things are feeling flat.  

Will take a look at the shader for this when I get a chance :)

Spoiler
Code: java
package data.scripts.plugins;

import java.util.List;

import org.lwjgl.util.vector.Vector2f;

import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.CollisionClass;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipHullSpecAPI;
import com.fs.starfarer.api.combat.WeaponAPI;

import java.awt.Color;
import java.util.HashMap;
import java.util.Map;
import org.dark.shaders.light.LightShader;
import org.dark.shaders.light.StandardLight;
import org.lwjgl.util.vector.Vector3f;


public class ShipPhysics implements EveryFrameCombatPlugin {

private CombatEngineAPI engine;
        private float height;
        private float width;
        private boolean doneOnce = false;
        private StandardLight sunLight = new StandardLight();
        
        public static Map darkMap = new HashMap();

        @Override
public void init(CombatEngineAPI engine) {
this.engine = engine;
                this.height = engine.getMapHeight() / 2f;
                this.width = engine.getMapWidth() / 2f;
                this.sunLight = new StandardLight();
}

        @Override
public void advance(float amount, List events)
{
            if (engine.isPaused()) return;

            //StandardLight
            //if(!doneOnce){
                //Create the new light
                sunLight.setColor(255,255,255);
                sunLight.setType(3);
                Vector3f dir = new Vector3f(-0.57735f, -0.57735f, -0.57735f);
                sunLight.makePermanent();
                //sunLight.setLifetime(0.1f);
                //sunLight.fadeOut(0.05f);
                sunLight.setDirection(dir);
                sunLight.setIntensity(0.5f);
                sunLight.setSpecularIntensity(0.5f);
                LightShader.addLight(sunLight);                  
                //doneOnce = true;
            //}    
            sunLight.setLocation(engine.getViewport().getCenter());
            
            //Gets all ships;
            for (ShipAPI ship : engine.getShips()){
                if(!darkMap.containsKey(ship)){
                    ship.getSpriteAPI().setColor(new Color(32,32,32,255));
                    for(WeaponAPI weapon : ship.getAllWeapons()){
                        if(!weapon.getSlot().isHardpoint() && !weapon.getSlot().isDecorative() && !weapon.getSlot().isSystemSlot()){
                            weapon.getSprite().setColor(new Color(32,32,32,255));
                        }
                    }
                    darkMap.put(ship,ship);
                }
 }
}
[close]
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #68 on: July 06, 2014, 08:06:53 PM »

After a bit of tweaking... here we go, it's lit with a directional source. 

Unfortunately, the lighting isn't what I was expecting; the lighting isn't using the normals at all here and is really flat. 

I'm also seeing pretty crazy boost to bloom and it's shimmering, like the sprite isn't quite matching up positionally.  Ah well, one problem at a time :)



Logged
Please check out my SS projects :)
Xeno's Mod Pack

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #69 on: July 06, 2014, 09:08:26 PM »



Just takes a bit of tweaking, honestly.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #70 on: July 06, 2014, 09:17:54 PM »

Hey, that's great, I got Blinn working too, after fixing up the shader :)


What's up with the bloom, though?  Things like engines are creating mega-bloom atm.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

PCCL

  • Admiral
  • *****
  • Posts: 2016
  • still gunnyfreak
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #71 on: July 06, 2014, 09:20:41 PM »

that astral... looks amazing

much better than the stuff on the front page

is it hard to make all ships like that? (I intend to do so when I get back)
Logged
mmm.... tartiflette

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #72 on: July 06, 2014, 11:44:02 PM »

OK, I think I got the shader largely sorted out, for what I want it to do; will get material support working tomorrow :)


Logged
Please check out my SS projects :)
Xeno's Mod Pack

FasterThanSleepyfish

  • Admiral
  • *****
  • Posts: 729
  • Blub
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #73 on: July 07, 2014, 12:46:38 AM »



Just takes a bit of tweaking, honestly.

Ugly as that Astral may seem, IRL, it's pretty realistic. Needs more lens flares though.
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7214
  • Harpoon Affectionado
    • View Profile
Re: '3D' Starsector Ship - Does this look good or bad? Vote Now!
« Reply #74 on: July 07, 2014, 08:09:21 AM »



Just takes a bit of tweaking, honestly.

Ugly as that Astral may seem, IRL, it's pretty realistic. Needs more lens flares though.

It may just need more tweaking, but I'm not a fan. The contrast is so high that the whole thing feels washed out. And for some reason my eyes keep telling me its a little toy model rather than a big ship.
Logged
Pages: 1 ... 3 4 [5] 6 7