• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

King_of_Dale

Recruit
Oct 17, 2012
2
0
Hello guys,
I hope someone can help me here, especially since I'm still a total beginner. The following problem: I'm currently working on my own small submod for the various Star Trek mods. It changes the look of the galaxy background; see example picture No. 01. So far everything works perfectly. I used “Real Space” from Annatar as the base code to display 3D effects thanks to different layers (values from “position y=-3.000” to “position y=0.000”) in my file "grid_galaxy_particle.asset".

I came across the great mod “Improved Hyperlanes and Fog of War - Legacy”. It changes the FoW by completely covering the unknown galaxy background and planets/nebula in black. The FoW mod works perfectly with the vanilla galaxy background; see example picture No. 02.

Now I wanted to integrate this mod into my own. However, if I use my own submod or, for example, "Real Space", you can't see the planets/nebulae, but the galaxy is still visible in the background (i.e. everything under "position y=0.000"); see example picture No. 03.

Can the FoW be expanded at all for “lower” layers? If yes, can someone help me?


Here is the code from the file “terra_incognita.fxh”, taken from “Improved Hyperlanes and Fog of War - Legacy”:
PixelShader = {
Code
[[
static const float GALAXY_SIZE = 2000.f;
static const float TI_BLEND_START = 0.01f;
static const float TI_BLEND_STOP = 0.2f;
static const float TI_GRAY_BRIGHTNESS = 0.00f;

float Desaturate( float3 vColor )
{
return dot( vColor, float3( 0.212671f, 0.715160f, 0.072169f ) );
}

float CalcTerraIncognitaValue( float2 vWorldPos2D, in sampler2D TITexture )
{
float2 vTIUV = ( vWorldPos2D + GALAXY_SIZE * 0.5f ) / GALAXY_SIZE;
float vTI = tex2D( TerraIncognitaTexture, vTIUV ).a;

return smoothstep( TI_BLEND_START, TI_BLEND_STOP, vTI );
}

float4 ApplyTerraIncognitaValue( float4 vColor, float vBrightness, float vTI)
{
float Grey = Desaturate( vColor.rgb ) * TI_GRAY_BRIGHTNESS * vBrightness;
//Grey = TI_DARK + ( ( TI_BRIGHT - TI_DARK ) * ( Grey ) ) / 1.f;

vColor.rgb = lerp( vec3( Grey ), vColor.rgb, vTI );

return vColor;
}

float4 ApplyTerraIncognita( float4 vColor, float2 vWorldPos2D, float vBrightness, in sampler2D TITexture )
{
float vTI = CalcTerraIncognitaValue( vWorldPos2D, TITexture );
return ApplyTerraIncognitaValue( vColor, vBrightness, vTI);
}

]]
}

And here my "grid_galaxy_particle.asset" file:

particle={
name="grid_galaxy"
subsystem={
name="galaxy"
max_amount=1
slave_particles=0
sort = "depth"
emitter_type="point"
invert=no
trail=no
local_space=yes
billboard=no
hide=no
texture={
file="gfx/particles/grid_galaxy.dds"
x=1
y=1
shader="ParticleAdditive"
}
color={
alpha=100.000
}
position={
x=0.000
y=-3.000
z=0.000
}
start=0.000
duration=-1.000
velocity=0.000
life=9999999.000
emission=1.000
size=135.000
rotation=180.000
particle_pitch=90.000
rotation_speed=0.000
}
subsystem={
name="stars_1"
max_amount=1
slave_particles=0
sort = "depth"
emitter_type="point"
invert=no
trail=no
local_space=yes
billboard=no
hide=no
texture={
file="gfx/particles/grid_stars_1.dds"
x=1
y=1
shader="ParticleAdditive"
}
color={
alpha=50.000
}
position={
x=0.000
y=-1.500
z=0.000
}
start=0.000
duration=-1.000
velocity=0.000
life=9999999.000
emission=1.000
size=135.000
rotation=180.000
particle_pitch=90.000
rotation_speed=0.000
}
subsystem={
name="stars_2"
max_amount=1
slave_particles=0
sort = "depth"
emitter_type="point"
invert=no
trail=no
local_space=yes
billboard=no
hide=no
texture={
file="gfx/particles/grid_stars_2.dds"
x=1
y=1
shader="ParticleAdditive"
}
color={
alpha=80.000
}
position={
x=0.000
y=-1.000
z=0.000
}
start=0.000
duration=-1.000
velocity=0.000
life=9999999.000
emission=1.000
size=180.000
rotation=180.000
particle_pitch=90.000
rotation_speed=0.000
}
subsystem={
name="stars_3"
max_amount=1
slave_particles=0
sort = "depth"
emitter_type="point"
invert=no
trail=no
local_space=yes
billboard=no
hide=no
texture={
file="gfx/particles/grid_stars_3.dds"
x=1
y=1
shader="ParticleAdditive"
}
color={
alpha=50.000
}
position={
x=0.000
y=-0.500
z=0.000
}
start=0.000
duration=-1.000
velocity=0.000
life=9999999.000
emission=1.000
size=135.000
rotation=180.000
particle_pitch=90.000
rotation_speed=0.000
}
subsystem={
name="stars_4"
max_amount=1
slave_particles=0
sort = "depth"
emitter_type="point"
invert=no
trail=no
local_space=yes
billboard=no
hide=no
texture={
file="gfx/particles/grid_stars_4.dds"
x=1
y=1
shader="ParticleAdditive"
}
color={
alpha=80.000
}
position={
x=0.000
y=0.000
z=0.000
}
start=0.000
duration=-1.000
velocity=0.000
life=9999999.000
emission=1.000
size=180.000
rotation=180.000
particle_pitch=90.000
rotation_speed=0.000
}
subsystem={
name="stars_5"
max_amount=1
slave_particles=0
sort = "depth"
emitter_type="point"
invert=no
trail=no
local_space=yes
billboard=no
hide=no
texture={
file="gfx/particles/grid_stars_5.dds"
x=1
y=1
shader="ParticleAdditive"
}
color={
alpha=50.000
}
position={
x=0.000
y=-2.500
z=0.000
}
start=0.000
duration=-1.000
velocity=0.000
life=9999999.000
emission=1.000
size=135.000
rotation=180.000
particle_pitch=90.000
rotation_speed=0.000
}
subsystem={
name="flare"
max_amount=3
slave_particles=0
sort="depth"
emitter_type="point"
invert=no
trail=no
local_space=yes
billboard=yes
hide=no
texture={
file="gfx/particles/flare_wide.dds"
x=1
y=1
shader="ParticleAdditive"
}
color={
x=200.000
y=210.000
z=215.000
alpha=17.000,flash_fade
}
position={
x=0.000
y=-2.000
z=0.000
}
start=0.000
duration=-1.000
emitter_yaw={ 0.000 0.000 }
emitter_pitch={ 0.000 0.000 }
velocity_pitch=90.000
velocity_yaw=0.000
velocity=0.000
life=5.000
emission=1.000
size=20.000
particle_pitch=90.000
rotation=0.000
}
animation={
name="flash_fade"
start=0.000
duration=1.000
repeat=no
minValue=0.000
maxValue=1.000
curve={
0.000 0.000 0.200 1.000 0.600 1.000 1.000 0.000
}
op="MUL"
time="life"
}
force={
type="point"
name="point"
position={
0.000 0.000 0.000
}
direction={
0.000 1.000 0.000
}
local_force=yes
yaw=0.000
division=16
amount=-0.020
}
force={
type="spin"
name="orbit"
position={
0.000 0.000 0.000
}
direction={
0.000 -0.200 0.000
}
local_force=yes
yaw=0.000
division=16
amount=0.003
}
}
 

Attachments

  • No.01.jpg
    No.01.jpg
    349,7 KB · Views: 0
  • No.02.jpg
    No.02.jpg
    200,6 KB · Views: 0
  • No.03.jpg
    No.03.jpg
    328,7 KB · Views: 0