Jump to content

Haydenmango

Members
  • Posts

    434
  • Joined

  • Last visited

Posts posted by Haydenmango

  1. Hey everyone I had an idea this morning and it seems like it worked!

    What I did to the ssao shader was very simple and it seems to work as intended. I just thought I would share this because I found it useful. If there are any issues let me know.

    Credit for the original ssao.shader goes to Igor as well as Josh and Shadmar. The original ssao.shader can be found here - http://www.leadwerks.com/werkspace/page/viewitem?fileid=393925036

    Also, before doing this I recommend saving a back up of your ssao.shader just in case.

     

    In the Fragment section of the ssao.shader

     

    replace the main loop with this -

     

    void main(void)
    {
    float depth;
    float lineardepth;
    vec2 pixelsize = 1.0 / buffersize;
    vec2 texcoord = GetTexCoord();
    
    depth = texelFetch(texture1, ivec2(texcoord * buffersize), 0).x;
    
    if(depth < 1.0) {
    lineardepth = DepthToZPosition(depth);
    if(lineardepth < 62.5) {
    vec2 rotationTC=(texcoord*buffersize)/4.0;
    vec3 vRotation=normalize((texture(texture10, rotationTC).xyz * 2.0) - 1.0);
    mat3 rotMat=vec3tomat3(vRotation);
    
    float fSceneDepthP = DepthToZPosition(depth);
    
    float offsetScale = aoscale;
    float offsetScaleStep = 1.0 + 1.5 / samples;
    
    
    float ao = 0.0;
    
    for(int i = 0; i < (samples / 8); i++)
    for(int x = -1; x <= 1; x += 2)
    for(int y = -1; y <= 1; y += 2)
    for(int z = -1; z <= 1; z += 2)
    {
     vec3 vOffset = normalize (vec3(x, y, z)) * (offsetScale *= offsetScaleStep);
     vec3 vRotatedOffset = rotMat * vOffset;
     vec3 vSamplePos = vec3(texcoord, fSceneDepthP);
     vSamplePos += vec3(vRotatedOffset.xy, vRotatedOffset.z * fSceneDepthP*raycasts);
    
     float fSceneDepthS = DepthToZPosition(texelFetch(texture1, ivec2(vSamplePos.xy * buffersize), 0).x);
     float fRangeIsInvalid = clamp(((fSceneDepthP - fSceneDepthS) / fSceneDepthS), 0.0, 1.0);
    
     ao += mix(clamp(ceil(fSceneDepthS - vSamplePos.z), 0.0, 1.0), 0.5, fRangeIsInvalid);
    }
    
    ao /= samples * 1.5;
    fragData0 = vec4(clamp(ao + ao + ao * 1.22, 0.0, 1.0));
    }
    else {
    fragData0 = vec4(1.0);
    }
    }
    else {
    fragData0 = vec4(1.0);
    }
    }
    

     

    To edit the distance cutoff range just change 62.5 in lineardepth < 62.5 to a different float value.

    • Upvote 4
  2. I agree with Rick here that turning off physics on hidden entities or entities that are outside of view range would be extremely helpful.

     

    The vegetation system is amazing for non-interactive objects that don't need to be in a specific position like grass, bushes, rocks, and the like but what about buildings or other objects you would see placed in a city? Cities would need specifically placed objects and there could be things like cars that you interact with. In that case having entities turn off their physics when out of view range would be perfect since the vegetation system isn't an option for those objects.

     

    Turning off physics on hidden entities or entities outside of view range could be a major benefit to anything that isn't using the vegetation system. smile.png

    • Upvote 1
  3. After looking more into this I found that it is specifically the Billboards that are creating this issue.

    I have grass and rock vegetation layers that don't use billboards as well as a bush layer that uses billboards. When I get rid of the bush layer the issue goes away.

    Also I noticed that most of the time the reflections don't get distorted but the reflections do always get darker and I'm not sure if that's intended.

     

    Before (with bush vegetation layer) - post-10578-0-90839100-1450742854_thumb.jpg

     

    After (without bush vegetation layer) - post-10578-0-06830900-1450742860_thumb.jpg

  4. Well after much consideration I took the easy way out and just bought a new laptop. It's working very well for me so far and the graphics improvement is unreal! Now I can play all my games on the highest graphics settings without lag. biggrin.png

     

    I got this laptop -

    https://www.asus.com/us/Notebooks/GL771/

     

    Anyways I just wanted to say thanks for all the help. Even though I didn't end up building my own computer all the advice that was given helped me decide to get this computer.

  5. Thanks for all the feedback everyone!

     

    After taking things into consideration I have decided to use this build - https://pcpartpicker.com/user/Haydenmango/saved/

     

    It's pretty much the same build I just changed out the hitachi hard drive for a western digital hard drive and added on the OS as well as the monitor. I also ditched the CPU cooler since I will not be overclocking. The total was under my budget so I decided to keep the CPU and motherboard. As for an optical drive I am looking into getting an external optical drive but haven't decided on which one yet.

     

    I will be ordering the parts this week and will let you all know how it works out! smile.png

  6. Well I have a Nvidia card so that might have something to do with it. I also figured out that this only happens when the terrain quality is either medium or high. This is from my program log after starting Leadwerks and turning water mode to true -

     

    programlog.txt

     

    Edit-

     

    Ok, I didn't actually see the error the last time (or the water for that matter) so I tested it again. When I tested it the second time I moved the camera to look at the water and two shaders loaded (which I'm guessing are the shaders that are causing the issue). Here is the second program log from when I actually saw the error. -

     

    programlog2.txt

  7. It was actually not working right before. Now it is working correctly. It only uses one global texture to cover the terrain, so there is no clipmap rendering and it will go faster.

    Hmm.. that's unfortunate. The terrain on low settings didn't look good but it was playable (and increased my fps) before but now I can't see it being used for anything. Oh well, I guess this isn't a bug then.

  8. The only thing I can think of is that your Light is only casting Static shadows. Try to set it to Static+Dynamic or Static+Dynamic+Buffered (if it isn't already), I'm not sure what could be wrong other than that.

    • Upvote 1
  9. So I have been working on a game based around throwing ragdolls called Castle Defender. The concept is pretty much the same as Defend Your Castle ( http://www.xgenstudios.com/play/castle ) except for that it takes place in 3D.

     

    My issue is that I want to have many more active enemies but I can only have a few enemies active before the fps drops to low. If someone could help me find the cause of this low performance I would be very grateful!

     

    I have made a small test project that includes the base features of my game, feel free to check it out and play around with things!

     

    Test Project - https://www.dropbox.com/s/f175yk9mvaxkf9p/Test.zip?dl=0

  10. I have been having issues with this change lately. I can no longer accurately code positions quickly (I don't want to convert cm to meters every time I write code).

     

    You can use a meter grid if you enable legacy settings. See the config file for this.

     

    Could an option be added to toggle between the meter and cm grids?

    Then we could use cm grid for texturing/csg/modeling and still use the meter grid for placing objects (easily) with code.

    • Upvote 1
×
×
  • Create New...