Changeset 1813 for trunk/tutorial


Ignore:
Timestamp:
Aug 24, 2012, 3:28:43 PM (8 years ago)
Author:
sam
Message:

tutorial: fix the FBO demo on the Xbox360.

Location:
trunk/tutorial
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tutorial/08_fbo.cpp

    r1773 r1813  
    9191        Video::Clear(ClearMask::Depth);
    9292        m_shader->Bind();
     93
     94#if _XBOX
     95        /* FIXME: the Xbox enforces full EDRAM clears on each frame, so
     96         * we cannot expect the render target contents to be preserved.
     97         * This code snippet should be moved inside the FrameBuffer class. */
     98        m_shader->SetUniform(m_uni_flag, 1.f);
     99        m_shader->SetUniform(m_uni_texture, m_fbo->GetTexture(), 0);
     100        m_vdecl->SetStream(m_vbo, m_coord);
     101        m_vdecl->Bind();
     102        m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 2);
     103        m_vdecl->Unbind();
     104#endif
     105
    93106        m_shader->SetUniform(m_uni_flag, 0.f);
    94107        m_shader->SetUniform(m_uni_point, m_hotspot);
  • trunk/tutorial/08_fbo.lolfx

    r1774 r1813  
    3535        {
    3636            float s = 6.0 + 3.0 * in_Point.z;
    37             vec2 p = pass_Position - in_Point.xy * 0.8;
     37            vec2 p = pass_Position - in_Point.xy * 0.9;
    3838            float t = clamp(1.2 - dot(s * p, s * p), 0.0, 1.0);
    3939            float u = t * t * t * t;
     
    7575        {
    7676            float s = 6.0 + 3.0 * in_Point.z;
    77             float2 p = pass_Position - in_Point.xy * 0.8;
     77            float2 p = pass_Position - in_Point.xy * 0.9;
    7878            float t = clamp(1.2 - dot(s * p, s * p), 0.0, 1.0);
    7979            float u = t * t * t * t;
     
    8686    else
    8787    {
    88         float2 texcoords = pass_Position * 0.5 + float2(0.5, 0.5);
     88        float2 texcoords = pass_Position * float2(0.5, -0.5) + float2(0.5, 0.5);
     89        /* FIXME: this should be passed as a uniform or something */
     90        texcoords += float2(0.5 / 800.0, 0.5 / 600.0);
    8991        out_FragColor = float4(tex2D(in_Texture, texcoords).xyz, 1.0);
    9092    }
Note: See TracChangeset for help on using the changeset viewer.