Jump to content

YouGroove

Members
  • Posts

    4,978
  • Joined

  • Last visited

Posts posted by YouGroove

  1. void PhysicsSetPosition(float x, float y, float z, float strength=0.5)

     

    Why the function don't have the position as a Vector 3 like some other functions ?

    void PhysicsSetPosition(Vec3 position, float strength=0.5)

     

    It is less typing , shorter code and faster to read.

  2. Trees almost look like hands/fingers, extra creepy

    Inspiration from Oblivion demonic realm , some should be animated and able to bend and attack with their branches spikes when the player passes nearby.

     

     

    Some custom Zbrush wall that should use detail texture shader.

    wall.jpg

  3. outcolor *= texture(texture3,ex_texcoords0*materialcolorspecular.r*20.0)*2.0;

     

    Multiplying the detail texture lookup by two will ensure that the detail texture doesn't darken the image. This is what a Mod2X blend is, which was originally used with lightmapping.

    Just some personnal taste :

    It was too bright with material color full white and a directionnal light with intensity = 1 , because it did not respect original texture diffuse contrast or power. I find 1,3 or 1.5 lot better and not too overbright.

     

     

     

    Also, you can use the "soften mipmaps" setting to make these fade out at lower mipmap resolutions. This will prevent your material from getting a repetitive appearance.

    But you will loose all details benefits of a detail texture.

     

    Anyway the shader is free anyone can customize it for their needs smile.png

  4. Thanks master wink.png , if you would know how much small thing like thant can speed up a lot level design.

     

    Some other uses, make new materials keeping the same pattern, but changing the detail map texture and it's UV scaling.

    detailmaps.jpg

    • Upvote 1
  5. Usefull to make rocks variations just changing the detail map.

     

    It can be used for walls , clothes micro details or anything else.

     

    detailtexture.jpg

     

     

    Material details :

    - Rock general diffuse/color and/or baked AO

    - Rock general normal map

    Specular detail texture

    Diffuse detail texture

     

    detail_Slots3.jpg

     

     

    Specular red channel from the material color picker is used to choose the detail maps multiplicator factor, play with it to adjust the UV scaling easily.

    (The only specular material used for your 3D model is the specular map)

     

    detail_Specular.jpg

     

     

    Todo if i have time as i don't need it , use a detail normal map.

     

    Have fun smile.png

    diffuse+normal+specular+detail.zip

    • Upvote 5
  6. On leadwerks the physics is already time adjusted. Your version will start to misbehave on very high or low fps.

     

    You are wrong , read again my code rolleyes.gif

    It works constant on slower laptop even with comple level at 15 fps, while LE3 character controller was like lagging a lot using bigger speed movement.

     

    function Script:UpdatePhysics()
    rotation = self.entity:GetRotation(true)
    self.posFrame = self.entity:GetPosition(true)
    

     

    Anyway for high speed movemennt you will have LE3 character passing throught physics, this is where you need your own controller.

    Also LE3 character controller doesn't raycast to the floor or on high jump fall down speed it would not pass throught floor.

     

    Nevermind forget it, as it is a specific need, like specific needs you must do it yourself.

    I think all people are ok with LE3 character controller for all common cases, so my thread is just some suggestion , i am not asking anything finally.

  7. Besides what is stopping you from making a similar town in your modelling package and have one large texture for all of its models

    I was meaning not only grouping objects in the same atlas, but the ability to regroup tiling textures on the same atlas.

    Manually it is more complicated to regroup tiling textures and more prone to error plus it is a lot more time work.

    This sort of automated tool exists like plugins for example.

     

    But you are right this sort could be external and written in C# for example using open source libraries, you give it textures it packs them. The mots complicated part would be to be able to extract textures from the atlas in LE3 and create them in memory than assign them to materials.

     

    Yes this is only a suggestion, working with many textures and material i just see how much such tool would help, but perhaps we are only few who could exploit such tool to justify it need in LE3 rolleyes.gif

  8. Generating the navmesh it sinks under the floor if the floor is one big brush cube only.

    It seems like water some Zbuffer imprecision with AMD Cards, this is something specific to OpenGL unfortunatelly.

     

    I will not use such big cube for the floor but still the bug remains.

  9. I'm asking again because they have great advantages :

    - Fast loading times with less textures files to load

    - heavy optimisation because you need less materials on your levels

     

    Without too much work, be able on a basic atlas texture to choose a unit square dimension 256,512 etc ... would be already usefull.

     

  10. Some usefull modification to tweak models reflection power in the editor :

     

    Change this line of code in LE3 Environment shader to be able to control the level of reflection using the specular material adjustable value.

     

    vec4 emission = texture(texture5,cubecoord) * texture(texture2,ex_texcoords0) * materialcolorspecular ;
    

    post-3271-0-65273800-1444068177_thumb.jpg

  11. It is based on LE3 environment shader and Shadmar tweak.

     

    You can control specular and reflection using a specular map and a reflection map, instead of having some uniform specular (it works and looks lot better than the previous PBR style effect shader).

    This is usefull for metal parts where you need to control the amount of reflection and specular on the model textures.

     

    Enjoy smile.png

     

    #version 400
    #define BFN_ENABLED 1
    //Uniforms
    uniform sampler2D texture0;//diffuse map
    uniform sampler2D texture1;//normal map
    uniform sampler2D texture2;//reflection map
    uniform sampler2D texture3;//specular map
    uniform samplerCube texture5;//cube map
    uniform samplerCube texture15;//BFN map
    uniform mat4 cameramatrix;
    uniform mat4 projectioncameramatrix;
    uniform vec2 camerarange;
    uniform float camerazoom;
    uniform vec2 buffersize;
    uniform mat4 camerainversematrix;
    uniform vec4 ambientlight;
    uniform vec4 materialcolorspecular;
    uniform mat3 cameranormalmatrix;
    uniform vec3 cameraposition;
    uniform int decalmode;
    //Inputs
    in vec4 ex_vertexposition;
    in vec2 ex_texcoords0;
    in vec2 ex_texcoords1;
    in vec4 ex_color;
    in float ex_selectionstate;
    in vec3 ex_normal;
    in vec3 ex_tangent;
    in vec3 ex_binormal;
    in float clipdistance0;
    out vec4 fragData0;
    out vec4 fragData1;
    out vec4 fragData2;
    out vec4 fragData3;
    float DepthToZPosition(in float depth) {
    return camerarange.x / (camerarange.y - depth * (camerarange.y - camerarange.x)) * camerarange.y;
    }
    void main(void)
    {
    //Clip plane discard
    if (clipdistance0>0.0) discard;
    vec4 outcolor = ex_color;
    float alpha;
    //Modulate blend with diffuse map
    outcolor *= texture(texture0,ex_texcoords0);
    alpha = outcolor.a;
    
    
    vec4 color_specular = texture(texture3,ex_texcoords0) * materialcolorspecular;
    
    
    //Normal map
    vec3 normal = ex_normal;
    normal = normalize(texture(texture1,ex_texcoords0).xyz * 2.0 - 1.0);
    float ao = normal.z;
    normal = ex_tangent * normal.x + ex_binormal * normal.y + ex_normal * normal.z;
    
    //Cubemap
    vec3 cubecoord = normalize( ex_vertexposition.xyz - cameraposition );
    vec3 reflectdir = cameranormalmatrix * normal;
    //reflectdir.y *= -1.0;
    //cubecoord = reflect(reflectdir,cubecoord);
    cubecoord = reflect(cubecoord,reflectdir);
    
    vec4 emission = texture(texture5,cubecoord) * texture(texture2,ex_texcoords0) ;
    
    
    //Blend with selection color if selected
    fragData0 = outcolor;// * (1.0-ex_selectionstate) + ex_selectionstate * (outcolor*0.5+vec4(0.5,0.0,0.0,0.0));
    #if BFN_ENABLED==1
    //Best-fit normals
    fragData1 = texture(texture15,normalize(vec3(normal.x,-normal.y,normal.z)));
    fragData1.a = fragData0.a;
    #else
    //Low-res normals
    fragData1 = vec4(normalize(normal)*0.5+0.5,fragData0.a);
    #endif
    //float specular = materialcolorspecular.r * 0.299 + materialcolorspecular.g * 0.587 + materialcolorspecular.b * 0.114;
    
    float specular = color_specular.r * 0.299 + color_specular.g * 0.587 + color_specular.b * 0.114;
    
    int materialflags=1;
    if (ex_selectionstate>0.0) materialflags += 2;
    if (decalmode==1) materialflags += 4;//brush
    if (decalmode==2) materialflags += 8;//model
    if (decalmode==4) materialflags += 16;//terrain
    fragData1.a = materialflags/255.0;
    fragData2 = vec4(emission.rgb,specular);
    }
    

    post-3271-0-10665200-1444066901_thumb.jpg

×
×
  • Create New...