Board index FlightGear Development Effects and shaders

[SOLVED] Terrain shaders are dark at the moment

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Re: Terrain shaders are dark at the moment

Postby gral » Wed Sep 01, 2010 8:54 pm

AndersG wrote:
Hi Gerard,

You could add the gitorious repository under a different name and use that in the pull commands.
Alternatively you could rename (git remote rename <old> <new>) your old origin remote and add the new one.
(This later option would make your branches tracking origin/master start downloading from gitorious, though. However, that should not be much of a problem.)

Cheers,

Anders


Thanks, Anders, for the help. Just to add for Gérard, sometimes I use in my local fgdata directory
Code: Select all
% vi .git/config

to get a 'overview'.
But meantime my merge requests have been merged in and you can pull latest changes from master, also from mapserver fgdata master of course.

-gral
gral
 
Posts: 323
Joined: Mon Nov 16, 2009 2:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Terrain shaders are dark at the moment

Postby grtux » Thu Sep 02, 2010 10:41 am

AndersG wrote:
Hi Gerard,

You could add the gitorious repository under a different name and use that in the pull commands.
Alternatively you could rename (git remote rename <old> <new>) your old origin remote and add the new one.
(This later option would make your branches tracking origin/master start downloading from gitorious, though. However, that should not be much of a problem.)

Cheers,

Anders


which do NOT work ,
with
git remote rename git://mapserver.flightgear.org/fgdata git://gitorious.org/fg/fgdata.git
we get
fatal: 'git://gitorious.org/fg/fgdata.git' is not a valid remote name

gral wrote:Thanks, Anders, for the help. Just to add for Gérard, sometimes I use in my local fgdata directory
Code: Select all
% vi .git/config

to get a 'overview'.
But meantime my merge requests have been merged in and you can pull latest changes from master, also from mapserver fgdata master of course.

-gral


Yes i have got the update ( more than 15 min , since could'nt get the .gitignore working with Aircraft directory)

The Landmass effects ON is right
The Crop Texture ON is longer "dark"

However, only an older code, crop.frag and crop.vert gives the right crop texture.

For the record here the code which suits to me .

Code: Select all
#version 120

varying vec4  rawpos;
varying vec4  ecPosition;
varying vec3  VNormal;
varying vec3  Normal;
varying vec4 constantColor;

uniform sampler3D NoiseTex;
uniform sampler2D SampleTex;
uniform sampler1D ColorsTex;

const float scale = 1.0;

const vec4 red = vec4(1.0, 0.0, 0.0, 1.0);
const vec4 green = vec4(0.0, 1.0, 0.0, 1.0);
const vec4 blue = vec4(0.0, 0.0, 1.0, 1.0);
const vec4 yellow = vec4(1.0, 1.0, 0.0, 1.0);

#define BLA 1
#define BLA2 0

void main (void)
{
   const float snowlevel=2000.0;

   vec4 basecolor = texture2D(SampleTex, rawpos.xy*0.000144);
   basecolor = texture1D(ColorsTex, basecolor.r+0.00);
   
   vec4 noisevec   = texture3D(NoiseTex, (rawpos.xyz)*0.01*scale);

   vec4 nvL   = texture3D(NoiseTex, (rawpos.xyz)*0.00066*scale);
   vec4 km = floor((rawpos)/1000.0);

   float fogFactor;
   float fogCoord = ecPosition.z;
   const float LOG2 = 1.442695;
   fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
//   float biasFactor = exp2(-0.00000002 * fogCoord * fogCoord * LOG2);
   float biasFactor = fogFactor = clamp(fogFactor, 0.0, 1.0);

   float n=0.06;
   n += nvL[0]*0.4;
   n += nvL[1]*0.6;
   n += nvL[2]*2.0;
   n += nvL[3]*4.0;
   n += noisevec[0]*0.1;
   n += noisevec[1]*0.4;

   n += noisevec[2]*0.8;
   n += noisevec[3]*2.1;
   n = mix(0.6, n, biasFactor);

   // good
   vec4 c1;
   c1 = basecolor * vec4(smoothstep(0.0, 1.15, n), smoothstep(0.0, 1.2, n), smoothstep(0.1, 1.3, n), 1.0);
   //"steep = gray"
   c1 = mix(vec4(n-0.42, n-0.44, n-0.51, 1.0), c1, smoothstep(0.970, 0.990, abs(normalize(Normal).z)+nvL[2]*1.3));
   //"snow"
   c1 = mix(c1, clamp(n+nvL[2]*4.1+vec4(0.1, 0.1, nvL[2]*2.2, 1.0), 0.7, 1.0), smoothstep(snowlevel+300.0, snowlevel+360.0, (rawpos.z)+nvL[1]*3000.0));

    vec3 diffuse = gl_Color.rgb * max(0.0, dot(VNormal, gl_LightSource[0].position.xyz));
    vec4 ambient_light = constantColor + gl_LightSource[0].diffuse * vec4(diffuse, 1.0);

   c1 *= ambient_light;
   vec4 finalColor = c1;

   if(gl_Fog.density == 1.0)
      fogFactor=1.0;

   gl_FragColor = mix(gl_Fog.color ,finalColor, fogFactor);
}



Code: Select all
#version 120

varying vec4  rawpos;
varying vec4  ecPosition;
varying vec3  VNormal;
varying vec3  Normal;
varying vec4 constantColor;
centroid varying vec4 ipos;

void main(void)
{
   gl_TexCoord[0]  = gl_MultiTexCoord0;

   rawpos     = gl_Vertex;
   ipos     = gl_Vertex;
   ecPosition = gl_ModelViewMatrix * gl_Vertex;
   VNormal = normalize(gl_NormalMatrix * gl_Normal);
   Normal = normalize(gl_Normal);
        gl_FrontColor = gl_Color;
        constantColor =  gl_FrontMaterial.emission
            + gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
   gl_Position = ftransform();
}







Cheers

Gérard

BTW: because of my difficulties with GIT , which is not usable in my situation ( hope temporary ) , i give up going on testing. Thanks for your work.
g.robin
LFMO
User avatar
grtux
 
Posts: 431
Joined: Thu Dec 14, 2006 5:19 pm
Location: Provence France

Re: Terrain shaders are dark at the moment

Postby AndersG » Thu Sep 02, 2010 5:06 pm

grtux wrote:which do NOT work ,
with
git remote rename git://mapserver.flightgear.org/fgdata git://gitorious.org/fg/fgdata.git
we get
fatal: 'git://gitorious.org/fg/fgdata.git' is not a valid remote name


That's because you have given it URLs instead of the local name (alias) given to the remote system. Try, e.g.
git remote rename origin mapserver-origin

/Anders
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2527
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Terrain shaders are dark at the moment

Postby gral » Fri Sep 03, 2010 8:19 am

Hi Gérard

I just saw that I really made a small change in the crop shader last week. I will have a look to this 'clean up' if it cleans up to much 8) I wonder that no one (?) else stated this issue.

Cheers, gral

EDIT: I sent a merge request bringing back constantColor. Hope this helps for you, does not matter here.
EDIT 2: Have been merged into current fgdata master.
gral
 
Posts: 323
Joined: Mon Nov 16, 2009 2:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Terrain shaders are dark at the moment (solved )

Postby grtux » Sat Sep 04, 2010 9:54 am

gral wrote:Hi Gérard

I just saw that I really made a small change in the crop shader last week. I will have a look to this 'clean up' if it cleans up to much 8) I wonder that no one (?) else stated this issue.

Cheers, gral



Hi, Gral

i have just "copy and paste" from gitorous server (not updated, due to the GIT usage lack, like said before) both files, crop.frag and crop.vert. The result is right, the crop terrain is good.

Thanks

Gérard
g.robin
LFMO
User avatar
grtux
 
Posts: 431
Joined: Thu Dec 14, 2006 5:19 pm
Location: Provence France

Re: Terrain shaders are dark at the moment

Postby ot-666 » Tue Sep 21, 2010 8:13 pm

gral wrote:Hi Gérard

I just saw that I really made a small change in the crop shader last week. I will have a look to this 'clean up' if it cleans up to much 8) I wonder that no one (?) else stated this issue.

Cheers, gral

EDIT: I sent a merge request bringing back constantColor. Hope this helps for you, does not matter here.
EDIT 2: Have been merged into current fgdata master.


I did not update since end of august (i gues right before this change was made) I figured out after yesterdays GIT update that the crop shader is producing a way to white(ish) green. It really used to look like nice crop, but now it looks like someone put a light milk cover over it. The crop has never been to dark on my system. Anyone else is having this issue?

Best regards, Oliver
Last edited by ot-666 on Tue Sep 21, 2010 10:02 pm, edited 1 time in total.
Callsign: ot-666
Working on LOWI and other stuff - Custom Scenery Overlay Repo: http://gitorious.org/fgfs-custom-scenery/custom-scenery-overlay/
VMX22 - Osprey... sometimes in 2014
ot-666
 
Posts: 746
Joined: Sun Nov 08, 2009 6:14 pm
Location: Germany, Konstanz
Callsign: ot-666
IRC name: ot666
Version: GIT
OS: win7 64bit

Re: [SOLVED] Terrain shaders are dark at the moment

Postby HHS » Tue Sep 21, 2010 9:36 pm

Yep- looks very strange. :?
Up, up and away
User avatar
HHS
 
Posts: 3625
Joined: Thu Jul 19, 2007 9:09 am
Version: GIT

Previous

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 2 guests