Genesys's Forum Posts

  • The title says it all..

    It would be very, very, very, very, very .. (999 very) .. useful..

  • I try, thanks..

  • Help? (I'm using 0.99 now, but same problem)

  • Hi,

    Today I started making a side-scrolling game.

    My platforms use a distort map to have a random shape.

    Very nice, it works as I like.. BUT! Collision masks, after the distorsion, don't update.

    So the player walks in the same rectangular platform without seeing the distorsion of the platform.

    Have you planned to implement it?

    Anyway, what can I do?

    Thanks

  • Wow this looks great

    Nice work mate!

    ~Sol

    Thanks SoldjahBoy!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well, I'm happy you like my game!

    Walls, door, various objects, weapons and player are made by me.. Monsters are not made by me. The rest are textures, and the normalmap on the room floor it's made in photoshop by a nvidia plugin.. All sounds by Half Life 2..

    Anyway I finished this game, and I would like to start a new bigger one, but I need the online plugin..

  • Very cool, Genesys.

    Great use of lighting and overall atmosphere.

    Thank you very much Caspis!

  • Fixed..

  • Zomg!

    <img src="https://dl.getdropbox.com/u/1105488/screen1.JPG">

    <img src="https://dl.getdropbox.com/u/1105488/screen2.JPG">

    Controls:

    W, A, S, D: Movement

    Mouse: Aim

    Mouse 1: Fire

    Mouse 2: Action over objects

    https://dl.getdropbox.com/u/1105488/Zomg.rar

    Enjoy

  • Hi,

    I made this simple water shader.. Check it out:

    https://dl.getdropbox.com/u/1105488/WaterRef.cap

    Genesys

  • Thanks.. Now I try making my own top-down water reflection effect.

  • I understood.. Thanks.

    I found it on a tutorial about shaders if I remember correctly..

  • Hi,

    I have this water shader HLSL code:

    struct WaterVertexToPixel
    
    {
    
    float4 Position : POSITION;
    
    float4 ReflectionMapSamplingPos : TEXCOORD1;
    
    float2 BumpMapSamplingPos : TEXCOORD2;
    
    float4 RefractionMapSamplingPos : TEXCOORD3;
    
    float4 Position3D : TEXCOORD4;
    
    };
    
    struct WaterPixelToFrame
    
    {
    
    float4 Color : COLOR0;
    
    };
    
    WaterVertexToPixel WaterVS(float4 inPos : POSITION, float2 inTex: TEXCOORD)
    
    {
    
    WaterVertexToPixel Output = (WaterVertexToPixel)0;
    
    float4�4 preViewProjection = mul (xView, xProjection);
    
    float4�4 preWorldViewProjection = mul (xWorld, preViewProjection);
    
    float4�4 preReflectionViewProjection = mul (xReflectionView, xProjection);
    
    float4�4 preWorldReflectionViewProjection = mul (xWorld, preReflectionViewProjection);
    
    Output.Position = mul(inPos, preWorldViewProjection);
    
    Output.ReflectionMapSamplingPos = mul(inPos, preWorldReflectionViewProjection);
    
    Output.RefractionMapSamplingPos = mul(inPos, preWorldViewProjection);
    
    Output.Position3D = inPos;
    
    float4 absoluteTexCoords = float4(inTex, 0, 1);
    
    float4 rotatedTexCoords = mul(absoluteTexCoords, xWindDirection);
    
    float2 moveVector = float2(0, 1);
    
    // moving the water
    
    Output.BumpMapSamplingPos = rotatedTexCoords.xy/xWaveLength + xTime*xWindForce*moveVector.xy;
    
    return Output;
    
    }
    
    WaterPixelToFrame WaterPS(WaterVertexToPixel PSIn)
    
    {
    
    WaterPixelToFrame Output = (WaterPixelToFrame)0;
    
    float2 ProjectedTexCoords;
    
    ProjectedTexCoords.x = PSIn.ReflectionMapSamplingPos.x/PSIn.ReflectionMapSamplingPos.w/2.0f + 0.5f;
    
    ProjectedTexCoords.y = -PSIn.ReflectionMapSamplingPos.y/PSIn.ReflectionMapSamplingPos.w/2.0f + 0.5f;
    
    // sampling the bump map
    
    float4 bumpColor = tex2D(WaterBumpMapSampler, PSIn.BumpMapSamplingPos);
    
    // perturbation of the color
    
    float2 perturbation = xWaveHeight*(bumpColor.rg � 0.5f);
    
    // the final texture coordinates
    
    float2 perturbatedTexCoords = ProjectedTexCoords + perturbation;
    
    float4 reflectiveColor = tex2D(ReflectionSampler, perturbatedTexCoords);
    
    float2 ProjectedRefrTexCoords;
    
    ProjectedRefrTexCoords.x = PSIn.RefractionMapSamplingPos.x/PSIn.RefractionMapSamplingPos.w/2.0f + 0.5f;
    
    ProjectedRefrTexCoords.y = -PSIn.RefractionMapSamplingPos.y/PSIn.RefractionMapSamplingPos.w/2.0f + 0.5f;
    
    float2 perturbatedRefrTexCoords = ProjectedRefrTexCoords + perturbation;
    
    float4 refractiveColor = tex2D(RefractionSampler, perturbatedRefrTexCoords);
    
    float3 eyeVector = normalize(xCamPos � PSIn.Position3D);
    
    float3 normalVector = float3(0,0,1);
    
    /////////////////////////////////////////////////
    
    // FRESNEL TERM APPROXIMATION
    
    /////////////////////////////////////////////////
    
    float fresnelTerm = (float)0;
    
    if ( fresnelMode == 0 )
    
    {
    
    fresnelTerm = 1-dot(eyeVector, normalVector)*1.3f;
    
    } else
    
    if ( fresnelMode == 1 )
    
    {
    
    fresnelTerm = 0.02+0.97f*pow((1-dot(eyeVector, normalVector)),5);
    
    } else
    
    if ( fresnelMode == 2 )
    
    {
    
    float fangle = 1.0f+dot(eyeVector, normalVector);
    
    fangle = pow(fangle,5);
    
    // fresnelTerm = fangle*50;
    
    fresnelTerm = 1/fangle;
    
    }
    
    // fresnelTerm = (1/pow((fresnelTerm+1.0f),5))+0.2f; //
    
    //Hardness factor � user input
    
    fresnelTerm = fresnelTerm * xDrawMode;
    
    //just to be sure that the value is between 0 and 1;
    
    fresnelTerm = fresnelTerm < 0? 0 : fresnelTerm;
    
    fresnelTerm = fresnelTerm > 1? 1 : fresnelTerm;
    
    // creating the combined color
    
    float4 combinedColor = refractiveColor*(1-fresnelTerm) + reflectiveColor*(fresnelTerm);
    
    /////////////////////////////////////////////////
    
    // WATER COLORING
    
    /////////////////////////////////////////////////
    
    float4 dullColor = float4(0.1f, 0.1f, 0.2f, 1.0f);
    
    float dullBlendFactor = xdullBlendFactor;
    
    Output.Color = (dullBlendFactor*dullColor + (1-dullBlendFactor)*combinedColor);
    
    /////////////////////////////////////////////////
    
    // Specular Highlights
    
    /////////////////////////////////////////////////
    
    float4 speccolor;
    
    float3 lightSourceDir = normalize(float3(0.1f,0.6f,0.5f));
    
    float3 halfvec = normalize(eyeVector+lightSourceDir+float3(perturbation.x*specPerturb,perturbation.y*specPerturb,0));
    
    float3 temp = 0;
    
    temp.x = pow(dot(halfvec,normalVector),specPower);
    
    speccolor = float4(0.98,0.97,0.7,0.6);
    
    speccolor = speccolor*temp.x;
    
    speccolor = float4(speccolor.x*speccolor.w,speccolor.y*speccolor.w,speccolor.z*speccolor.w,0);
    
    Output.Color = Output.Color + speccolor;
    
    return Output;
    
    }
    
    technique Water
    
    {
    
    pass Pass0
    
    {
    
    VertexShader = compile vs_2_0 WaterVS();
    
    PixelShader = compile ps_2_0 WaterPS();
    
    }
    
    }[/code:2191t6d9]
    
    And I would like to use it in Construct, but can someone convert this to make it work on Construct?
    
    When I try to use it in Construct, it gives to me an error about something like a perspective projection..
    
    Help, please?