Jump to content

Kronos

Members
  • Posts

    31
  • Joined

  • Last visited

Posts posted by Kronos

  1. Hi,

     

    I have finally started looking at shaders. I have made this little thing as a start based on something I found on the internet. This should take four textures, multiply them with alpha textures(red) and then add the results together. The sort of thing one might use for terrain texturing for instance.

     

    uniform sampler2D texture0;
    uniform sampler2D texture1;
    uniform sampler2D texture2;
    uniform sampler2D texture3;
    uniform sampler2D texture4;
    uniform sampler2D texture5;
    uniform sampler2D texture6;
    uniform sampler2D texture7;
    varying vec4 texCoord;
    
    void main()
    {
      	vec4 alpha1   = texture2D( texture0, texCoord.xy);
      	vec4 alpha2   = texture2D( texture1, texCoord.xy);
      	vec4 alpha3   = texture2D( texture2, texCoord.xy);
      	vec4 alpha4   = texture2D( texture3, texCoord.xy);
    
    vec4 tex1  = texture2D( texture4, texCoord.xy * 100.0 );	
    vec4 tex2  = texture2D( texture5, texCoord.xy * 100.0 );
    vec4 tex3  = texture2D( texture6, texCoord.xy * 100.0 );
    vec4 tex4  = texture2D( texture7, texCoord.xy * 100.0 );
    
    tex1 *= alpha1.r;
    tex2 *= alpha2.r;
    tex3 *= alpha3.r;
    tex4 *= alpha4.r;
    
    vec4 outcolor = tex1+tex2+tex3+tex4;
    
    
      gl_FragColor = outcolor;
    }
    
    
    
    

     

     

    My question is what vertex shader (if any) should I use with this. Any other tips would be welcome.

  2. A couple of queries.

     

    I want to add my own terrain texture to the list of available textures however just dropping it into the materials\terrain folder doesn't seem to work and it does not appear in the texture list. It is in DDS format. I've tried dropping it into an existing folder and also put it into a new folder.

     

    Is there something else I need to do?

     

     

    Whilst mucking about with the driver.lua script in the editor I notice when driving the viper in a tight circle the fps drop from 60 to 30 fps. Any ideas why this might be?

  3. The ability to import and use alphamaps for terrain in the editor. We have a terrain function to load alphamaps so it seems odd to me that the editor does not make use of it and seems to rely on height/angle info only. Many terrain programs use alphamaps eg L3DT.

×
×
  • Create New...