Serenity Travel Series Volume One [Blu-ray] (Blu-ray) newly tagged "blu-ray"

May 31, 2009 by admin · Comment
Filed under: Xbox360 News 
Serenity Travel Series Volume One [Blu-ray]

Serenity Travel Series Volume One [Blu-ray] (Blu-ray)
By Various

Buy new: $6.49
7 used and new from $6.48
Customer Rating: 3.8

First tagged “blu-ray” by Craig Miller
Customer tags: screen saver(2), work-out, ambient, sunrise, fathers day, relaxing, blu-ray

Total Recall [VHS] (VHS Tape) newly tagged "blu-ray"

May 31, 2009 by admin · Comment
Filed under: Xbox360 News 
Total Recall [VHS]

Total Recall [VHS] (VHS Tape)
By Arnold Schwarzenegger

69 used and new from $0.01
Customer Rating: 5.0

First tagged “blu-ray” by bernie “xyzzy”
Customer tags: action(2), science fiction(2), high definition, action movie, adventure, arnold schwarzenegger, cyberpunk, movie, dvd, blu-ray

How do I apply a texture when looping through Vertices array?

May 31, 2009 by admin · Comment
Filed under: Xbox360 News 

I thought a mod command would work.. which it does but it seems a rather ham fisted way. Is there a 'proper way'?

   private void SetUpVertices()
        {
            vertices = new VertexPositionTexture[roadWidth * roadHeight];
            for (int x = 0; x < roadWidth; x++)
            {
                for (int y = 0; y < roadHeight; y++)
                {
                    //vertices[x + y * roadWidth].Position = new Vector3(x, heightData[x, y], -y);
                    vertices[x + y * roadWidth].Position = new Vector3(x*boxSize, 0, -y*boxSize);

                    //can use either color or texture must change top line to vertexpositioncolor
                    //vertices[x + y * roadWidth].Color = Color.Gray;
                    if (y % 6 == 0)
                    {
                        vertices[x + y * roadWidth].TextureCoordinate.X = 0;
                        vertices[x + y * roadWidth].TextureCoordinate.Y = 0;
                    }
                    else if (y % 6 == 1)
                    {
                        vertices[x + y * roadWidth].TextureCoordinate.X = 1;
                        vertices[x + y * roadWidth].TextureCoordinate.Y = 1;
                    }
                    else if …..
                    {
           

and so on

How do I apply a texture when looping through Vertices array?

May 31, 2009 by admin · Comment
Filed under: Xbox360 News 

I thought a mod command would work.. which it does but it seems a rather ham fisted way. Is there a 'proper way'?

   private void SetUpVertices()
        {
            vertices = new VertexPositionTexture[roadWidth * roadHeight];
            for (int x = 0; x < roadWidth; x++)
            {
                for (int y = 0; y < roadHeight; y++)
                {
                    //vertices[x + y * roadWidth].Position = new Vector3(x, heightData[x, y], -y);
                    vertices[x + y * roadWidth].Position = new Vector3(x*boxSize, 0, -y*boxSize);

                    //can use either color or texture must change top line to vertexpositioncolor
                    //vertices[x + y * roadWidth].Color = Color.Gray;
                    if (y % 6 == 0)
                    {
                        vertices[x + y * roadWidth].TextureCoordinate.X = 0;
                        vertices[x + y * roadWidth].TextureCoordinate.Y = 0;
                    }
                    else if (y % 6 == 1)
                    {
                        vertices[x + y * roadWidth].TextureCoordinate.X = 1;
                        vertices[x + y * roadWidth].TextureCoordinate.Y = 1;
                    }
                    else if …..
                    {
           

and so on

Sprite Class and sprite size

May 31, 2009 by admin · Comment
Filed under: Xbox360 News 

I've made a class, which is rather simple, here's basically what's in it (excluding all the obvious other things):

public Texture2D texture { get; set; }
        public Vector2 position { get; set; }
        public Vector2 size { get; set; }
        public Sprite(Texture2D newTexture, Vector2 newPosition, Vector2 newSize)
        {
            texture = newTexture;
            position = newPosition;
            size = newSize;
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, position, Color.White);
        }

Now, I've been trying to get the actual size of the textures I'm drawing. It's doable by just writing new Vector2(Content.Load<Texture2D>("insertnamehere").Width,Content.Load<Texture2D>("insertnamehere").Height), but it's rather long and tedious to do so for every sprite you have. So I've been trying to immediatly get the size in there. Here's my best try (I guess);
I just added this to the class:

public void LoadContent(ContentManager content, string spriteName)
        {
            this.texture = content.Load<Texture2D>(spriteName);
            size = new Vector2(this.texture.Width, this.texture.Height);
        }

and in the LoadContent() method in the Game1.cs this is the line which should load it:
TestSprite = new Sprite(Content.Load<Texture2D>("Wobbly\\wobblysad"), new Vector2(0, 0), TestSprite.size);
and then the
TestSprite.Draw(spriteBatch);
to draw it.
This gives me the following error:
System.NullReferenceException was unhandled.

I've been trying different things but just can't seem to figure it out, could anyone point me out in the right direction?

Thanks in advance,
Aceria

 

Sprite Class and sprite size

May 31, 2009 by admin · Comment
Filed under: Xbox360 News 

I've made a class, which is rather simple, here's basically what's in it (excluding all the obvious other things):

public Texture2D texture { get; set; }
        public Vector2 position { get; set; }
        public Vector2 size { get; set; }
        public Sprite(Texture2D newTexture, Vector2 newPosition, Vector2 newSize)
        {
            texture = newTexture;
            position = newPosition;
            size = newSize;
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, position, Color.White);
        }

Now, I've been trying to get the actual size of the textures I'm drawing. It's doable by just writing new Vector2(Content.Load<Texture2D>("insertnamehere").Width,Content.Load<Texture2D>("insertnamehere").Height), but it's rather long and tedious to do so for every sprite you have. So I've been trying to immediatly get the size in there. Here's my best try (I guess);
I just added this to the class:

public void LoadContent(ContentManager content, string spriteName)
        {
            this.texture = content.Load<Texture2D>(spriteName);
            size = new Vector2(this.texture.Width, this.texture.Height);
        }

and in the LoadContent() method in the Game1.cs this is the line which should load it:
TestSprite = new Sprite(Content.Load<Texture2D>("Wobbly\\wobblysad"), new Vector2(0, 0), TestSprite.size);
and then the
TestSprite.Draw(spriteBatch);
to draw it.
This gives me the following error:
System.NullReferenceException was unhandled.

I've been trying different things but just can't seem to figure it out, could anyone point me out in the right direction?

Thanks in advance,
Aceria

 

Vertex Shader output structure not used in the Textures and Colors sample?

May 31, 2009 by admin · Comment
Filed under: Xbox360 News 

It seems as if the vertex shader output structure is not used in the Textures and Colors sample. The vertex shader in the fx file returns a vertex shader output struct, but I don't see where it is being input into the pixel shader. Instead there is a pixel shader input structure, but I can't see how the data from the vertex shader is being supplied to the pixel shader. Here's a copy of the shader. It seems fairly simple. I just can't understand how the data is getting from one place to the other.

shared float4×4 world;
shared float4×4 view;
shared float4×4 projection;

float4 lightColor;
float3 lightDirection;
float4 ambientColor;

//////////////////////////////////////////////////////////////
// Example 1.1                                              //
//                                                          //
// Textures may be set as EffectParameters as any other     //
// uniform data.                                            //
//////////////////////////////////////////////////////////////
texture modelTexture;

//////////////////////////////////////////////////////////////
// Example 1.2                                              //
//                                                          //
// Samplers are defined in the Effect code, and referred    //
// to by name in sampling instrinsic functions (like tex2D) //
// elsewhere in the effect.                                 //
//////////////////////////////////////////////////////////////
sampler ModelTextureSampler =
sampler_state
{
    // all samplers must specify which texture they are sampling from.
    Texture = <modelTexture>;
    
    //The MinFilter describes how the texture sampler will read for pixels
    //larger than one texel.
    MinFilter = Linear;
    //The MagFilter describes how the texture sampler will read for pixels
    //smaller than one texel.
    MagFilter = Linear;
    //The MipFilter describes how the texture sampler will combine different
    //mip levels of the texture.
    MipFilter = Linear;

    //The AddressU and AddressV values describe how the texture sampler will treat
    //a texture coordinate that is outside the range of [0-1].
    //In this case, it "clamps", where all values less than 0 are treated as 0,
    //and all values greater than 1 are treated as 1.  
    AddressU = Clamp;
    AddressV = Clamp;
};

struct VertexShaderInput
{
     float3 Position : POSITION;
     float4 Normal : NORMAL;
//////////////////////////////////////////////////////////////
// Example 1.3                                              //
//                                                          //
// The TEXCOORD0 and COLOR0 semantics now give us useful    //
// data, as the versions of the models for this sample      //
// include texture coordinate and vertex color data.        //
//////////////////////////////////////////////////////////////
     float2 TextureCoordinate : TEXCOORD0;
     float4 Color : COLOR0;
};

struct VertexShaderOutput
{
     float4 Position : POSITION;
     float4 Color : COLOR0;
     //The texture coordinate is interpolated across the triangle just like the color.
     float2 TextureCoordinate : TEXCOORD0;
};

struct PixelShaderInput
{
     float4 Color: COLOR0;
     //The interpolated texture coordinate for this pixel, calculated from the
     //texture coordinate values passed to the rasterizer for the three vertices that
     //make up this triangle.
     float2 TextureCoordinate : TEXCOORD0;
};

//////////////////////////////////////////////////////////////
// Example 1.4                                              //
//                                                          //
// Note the parameters passed to the functions, new to this //
// sample.  These fill the "uniform" bool arguments on the  //
// functions above.  The techniques are evaluated when the  //
// effect is compiled, and the code is recompiled with each //
// boolean "variable" treated as a constant.  This means    //
// that the effect can duplicate code duplication while     //
// simultaneously avoiding often-costly run-time branches.  //
//////////////////////////////////////////////////////////////
VertexShaderOutput VertexShader(
     VertexShaderInput input,
     uniform bool modulateWithLight,
     uniform bool addToLight,
     uniform bool lightOnly )
{
     VertexShaderOutput output;

     //generate the world-view-proj matrix
     float4×4 wvp = mul(mul(world, view), projection);
     
     //transform the input position to the output
     output.Position = mul(float4(input.Position, 1.0), wvp);

     // calculate the lighting color
     float3 worldNormal =  mul(input.Normal, world);
     float diffuseIntensity = saturate( dot(-lightDirection, worldNormal));
     float4 diffuseColor = lightColor * diffuseIntensity;
     float4 lightingColor = diffuseColor + ambientColor;
     diffuseColor.a = 1.0;
     
     // calculate the final color
//////////////////////////////////////////////////////////////
// Example 1.5                                              //
//                                                          //
// "Modulation" is a mathematical operation where one value //
// is scaled by another, via multiplication.                //
//////////////////////////////////////////////////////////////
     if (modulateWithLight)
     {
         output.Color = input.Color * lightingColor;
     }
     else if (addToLight)
     {
//////////////////////////////////////////////////////////////
// Example 1.6                                              //
//                                                          //
// The "saturate" intrinsic function, new to this sample,   //
// caps the value (or each value in a vector type) to the   //
// range [0.0, 1.0].                                        //
//                                                          //
// The decision of whether to saturate a particular value   //
// is an important one in many complex shaders, including   //
// high-dynamic range (HDR) effects.                        //
//////////////////////////////////////////////////////////////
         output.Color = saturate(input.Color + lightingColor);
     }
     else if (lightOnly)
     {
         output.Color = lightingColor;
     }
     else
     {
         output.Color = input.Color;
     }
     
     // pass through the texture coordinate
     output.TextureCoordinate = input.TextureCoordinate;

     //return the output structure
     return output;
}

//This function also now features "uniform" parameters.
//These parameters are specified in the technique definition, allowing different
//techniques to specify different "paths" through one function.  This minimizes
//code duplication, a common source of bugs.
//These booleans are evaluated at compile-time, avoiding costly run-time
//code-path evalution.
float4 PixelShader(PixelShaderInput input,
                         uniform bool modulateWithTexture,
                         uniform bool addToTexture,
                         uniform bool textureOnly) : COLOR
{
//////////////////////////////////////////////////////////////
// Example 1.7                                              //
//                                                          //
// The "tex2D" intrinsic function reads from a 2D texture.  //
// In the XNA framework, this means a Texture2D object.     //
// There are similar texCUBE and tex3D functions for        //
// TextureCube and Texture3D, respectively.                 //
//////////////////////////////////////////////////////////////
     float4 textureColor = tex2D(ModelTextureSampler, input.TextureCoordinate);

     //calculate the final color.  The input color represents the interpolated output
     //of the vertex shader, whatever it happened to be.
     float4 outputColor;
     if (modulateWithTexture)
     {
         outputColor = input.Color * textureColor;
     }
     else if (addToTexture)
     {
//////////////////////////////////////////////////////////////
// Example 1.6 (duplicated)                                 //
//                                                          //
// The "saturate" intrinsic function, new to this sample,   //
// caps the value (or each value in a vector type) to the   //
// range [0.0, 1.0].                                        //
//                                                          //
// The decision of whether to saturate a particular value   //
// is an important one in many complex shaders, including   //
// high-dynamic range (HDR) effects.                        //
//////////////////////////////////////////////////////////////
         outputColor = saturate(input.Color + textureColor);
     }
     else if (textureOnly)
     {
         outputColor = textureColor;
     }
     else
     {
         outputColor = input.Color;
     }

     return outputColor;
}

//////////////////////////////////////////////////////////////
// Example 1.8                                              //
//                                                          //
// The definitions for all of the techniques follow.  There //
// is one technique for each logical combination of         //
// lighting color, vertex color, and texture color, and     //
// basic math operations to combine them.  The first        //
// technique shows a typical combination, then each element //
// of the calculation, then simple two-way combinations,    //
// then alternative three-way combinations.                 //
//                                                          //
// "Mod" in the technique name stands for "modulate", an    //
// operation where one value is scaled by another, via      //
// multiplication.                                          //
//                                                          //
// Note the parameters passed to the functions, new to this //
// sample.  These fill the "uniform" bool arguments on the  //
// functions above.  The techniques are evaluated when the  //
// effect is compiled, and the code is recompiled with each //
// boolean "variable" treated as a constant.  This means    //
// that the effect can duplicate code duplication while     //
// simultaneously avoiding often-costly run-time branches.  //
//////////////////////////////////////////////////////////////

technique LightingModColorModTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(true, false, false);
          PixelShader = compile ps_2_0 PixelShader(true, false, false);
    }
}

technique LightingOnly
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, true);
          PixelShader = compile ps_2_0 PixelShader(false, false, false);
    }
}

technique ColorOnly
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, false);
          PixelShader = compile ps_2_0 PixelShader(false, false, false);
    }
}

technique TextureOnly
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, false);
          PixelShader = compile ps_2_0 PixelShader(false, false, true);
    }
}

technique LightingModColor
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(true, false, false);
          PixelShader = compile ps_2_0 PixelShader(false, false, false);
    }
}

technique LightingAddColor
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, true, false);
          PixelShader = compile ps_2_0 PixelShader(false, false, false);
    }
}

technique LightingModTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, true);
          PixelShader = compile ps_2_0 PixelShader(true, false, false);
    }
}

technique LightingAddTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, true);
          PixelShader = compile ps_2_0 PixelShader(false, true, false);
    }
}

technique ColorModTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, false);
          PixelShader = compile ps_2_0 PixelShader(true, false, false);
    }
}

technique ColorAddTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, false);
          PixelShader = compile ps_2_0 PixelShader(false, true, false);
    }
}

technique LightingAddColorAddTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, true, false);
          PixelShader = compile ps_2_0 PixelShader(false, true, false);
    }
}

technique LightingAddColorModTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, true, false);
          PixelShader = compile ps_2_0 PixelShader(true, false, false);
    }
}

technique LightingModColorAddTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(true, false, false);
          PixelShader = compile ps_2_0 PixelShader(false, true, false);
    }
}

Vertex Shader output structure not used in the Textures and Colors sample?

May 31, 2009 by admin · Comment
Filed under: Xbox360 News 

It seems as if the vertex shader output structure is not used in the Textures and Colors sample. The vertex shader in the fx file returns a vertex shader output struct, but I don't see where it is being input into the pixel shader. Instead there is a pixel shader input structure, but I can't see how the data from the vertex shader is being supplied to the pixel shader. Here's a copy of the shader. It seems fairly simple. I just can't understand how the data is getting from one place to the other.

shared float4×4 world;
shared float4×4 view;
shared float4×4 projection;

float4 lightColor;
float3 lightDirection;
float4 ambientColor;

//////////////////////////////////////////////////////////////
// Example 1.1                                              //
//                                                          //
// Textures may be set as EffectParameters as any other     //
// uniform data.                                            //
//////////////////////////////////////////////////////////////
texture modelTexture;

//////////////////////////////////////////////////////////////
// Example 1.2                                              //
//                                                          //
// Samplers are defined in the Effect code, and referred    //
// to by name in sampling instrinsic functions (like tex2D) //
// elsewhere in the effect.                                 //
//////////////////////////////////////////////////////////////
sampler ModelTextureSampler =
sampler_state
{
    // all samplers must specify which texture they are sampling from.
    Texture = <modelTexture>;
    
    //The MinFilter describes how the texture sampler will read for pixels
    //larger than one texel.
    MinFilter = Linear;
    //The MagFilter describes how the texture sampler will read for pixels
    //smaller than one texel.
    MagFilter = Linear;
    //The MipFilter describes how the texture sampler will combine different
    //mip levels of the texture.
    MipFilter = Linear;

    //The AddressU and AddressV values describe how the texture sampler will treat
    //a texture coordinate that is outside the range of [0-1].
    //In this case, it "clamps", where all values less than 0 are treated as 0,
    //and all values greater than 1 are treated as 1.  
    AddressU = Clamp;
    AddressV = Clamp;
};

struct VertexShaderInput
{
     float3 Position : POSITION;
     float4 Normal : NORMAL;
//////////////////////////////////////////////////////////////
// Example 1.3                                              //
//                                                          //
// The TEXCOORD0 and COLOR0 semantics now give us useful    //
// data, as the versions of the models for this sample      //
// include texture coordinate and vertex color data.        //
//////////////////////////////////////////////////////////////
     float2 TextureCoordinate : TEXCOORD0;
     float4 Color : COLOR0;
};

struct VertexShaderOutput
{
     float4 Position : POSITION;
     float4 Color : COLOR0;
     //The texture coordinate is interpolated across the triangle just like the color.
     float2 TextureCoordinate : TEXCOORD0;
};

struct PixelShaderInput
{
     float4 Color: COLOR0;
     //The interpolated texture coordinate for this pixel, calculated from the
     //texture coordinate values passed to the rasterizer for the three vertices that
     //make up this triangle.
     float2 TextureCoordinate : TEXCOORD0;
};

//////////////////////////////////////////////////////////////
// Example 1.4                                              //
//                                                          //
// Note the parameters passed to the functions, new to this //
// sample.  These fill the "uniform" bool arguments on the  //
// functions above.  The techniques are evaluated when the  //
// effect is compiled, and the code is recompiled with each //
// boolean "variable" treated as a constant.  This means    //
// that the effect can duplicate code duplication while     //
// simultaneously avoiding often-costly run-time branches.  //
//////////////////////////////////////////////////////////////
VertexShaderOutput VertexShader(
     VertexShaderInput input,
     uniform bool modulateWithLight,
     uniform bool addToLight,
     uniform bool lightOnly )
{
     VertexShaderOutput output;

     //generate the world-view-proj matrix
     float4×4 wvp = mul(mul(world, view), projection);
     
     //transform the input position to the output
     output.Position = mul(float4(input.Position, 1.0), wvp);

     // calculate the lighting color
     float3 worldNormal =  mul(input.Normal, world);
     float diffuseIntensity = saturate( dot(-lightDirection, worldNormal));
     float4 diffuseColor = lightColor * diffuseIntensity;
     float4 lightingColor = diffuseColor + ambientColor;
     diffuseColor.a = 1.0;
     
     // calculate the final color
//////////////////////////////////////////////////////////////
// Example 1.5                                              //
//                                                          //
// "Modulation" is a mathematical operation where one value //
// is scaled by another, via multiplication.                //
//////////////////////////////////////////////////////////////
     if (modulateWithLight)
     {
         output.Color = input.Color * lightingColor;
     }
     else if (addToLight)
     {
//////////////////////////////////////////////////////////////
// Example 1.6                                              //
//                                                          //
// The "saturate" intrinsic function, new to this sample,   //
// caps the value (or each value in a vector type) to the   //
// range [0.0, 1.0].                                        //
//                                                          //
// The decision of whether to saturate a particular value   //
// is an important one in many complex shaders, including   //
// high-dynamic range (HDR) effects.                        //
//////////////////////////////////////////////////////////////
         output.Color = saturate(input.Color + lightingColor);
     }
     else if (lightOnly)
     {
         output.Color = lightingColor;
     }
     else
     {
         output.Color = input.Color;
     }
     
     // pass through the texture coordinate
     output.TextureCoordinate = input.TextureCoordinate;

     //return the output structure
     return output;
}

//This function also now features "uniform" parameters.
//These parameters are specified in the technique definition, allowing different
//techniques to specify different "paths" through one function.  This minimizes
//code duplication, a common source of bugs.
//These booleans are evaluated at compile-time, avoiding costly run-time
//code-path evalution.
float4 PixelShader(PixelShaderInput input,
                         uniform bool modulateWithTexture,
                         uniform bool addToTexture,
                         uniform bool textureOnly) : COLOR
{
//////////////////////////////////////////////////////////////
// Example 1.7                                              //
//                                                          //
// The "tex2D" intrinsic function reads from a 2D texture.  //
// In the XNA framework, this means a Texture2D object.     //
// There are similar texCUBE and tex3D functions for        //
// TextureCube and Texture3D, respectively.                 //
//////////////////////////////////////////////////////////////
     float4 textureColor = tex2D(ModelTextureSampler, input.TextureCoordinate);

     //calculate the final color.  The input color represents the interpolated output
     //of the vertex shader, whatever it happened to be.
     float4 outputColor;
     if (modulateWithTexture)
     {
         outputColor = input.Color * textureColor;
     }
     else if (addToTexture)
     {
//////////////////////////////////////////////////////////////
// Example 1.6 (duplicated)                                 //
//                                                          //
// The "saturate" intrinsic function, new to this sample,   //
// caps the value (or each value in a vector type) to the   //
// range [0.0, 1.0].                                        //
//                                                          //
// The decision of whether to saturate a particular value   //
// is an important one in many complex shaders, including   //
// high-dynamic range (HDR) effects.                        //
//////////////////////////////////////////////////////////////
         outputColor = saturate(input.Color + textureColor);
     }
     else if (textureOnly)
     {
         outputColor = textureColor;
     }
     else
     {
         outputColor = input.Color;
     }

     return outputColor;
}

//////////////////////////////////////////////////////////////
// Example 1.8                                              //
//                                                          //
// The definitions for all of the techniques follow.  There //
// is one technique for each logical combination of         //
// lighting color, vertex color, and texture color, and     //
// basic math operations to combine them.  The first        //
// technique shows a typical combination, then each element //
// of the calculation, then simple two-way combinations,    //
// then alternative three-way combinations.                 //
//                                                          //
// "Mod" in the technique name stands for "modulate", an    //
// operation where one value is scaled by another, via      //
// multiplication.                                          //
//                                                          //
// Note the parameters passed to the functions, new to this //
// sample.  These fill the "uniform" bool arguments on the  //
// functions above.  The techniques are evaluated when the  //
// effect is compiled, and the code is recompiled with each //
// boolean "variable" treated as a constant.  This means    //
// that the effect can duplicate code duplication while     //
// simultaneously avoiding often-costly run-time branches.  //
//////////////////////////////////////////////////////////////

technique LightingModColorModTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(true, false, false);
          PixelShader = compile ps_2_0 PixelShader(true, false, false);
    }
}

technique LightingOnly
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, true);
          PixelShader = compile ps_2_0 PixelShader(false, false, false);
    }
}

technique ColorOnly
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, false);
          PixelShader = compile ps_2_0 PixelShader(false, false, false);
    }
}

technique TextureOnly
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, false);
          PixelShader = compile ps_2_0 PixelShader(false, false, true);
    }
}

technique LightingModColor
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(true, false, false);
          PixelShader = compile ps_2_0 PixelShader(false, false, false);
    }
}

technique LightingAddColor
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, true, false);
          PixelShader = compile ps_2_0 PixelShader(false, false, false);
    }
}

technique LightingModTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, true);
          PixelShader = compile ps_2_0 PixelShader(true, false, false);
    }
}

technique LightingAddTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, true);
          PixelShader = compile ps_2_0 PixelShader(false, true, false);
    }
}

technique ColorModTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, false);
          PixelShader = compile ps_2_0 PixelShader(true, false, false);
    }
}

technique ColorAddTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, false, false);
          PixelShader = compile ps_2_0 PixelShader(false, true, false);
    }
}

technique LightingAddColorAddTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, true, false);
          PixelShader = compile ps_2_0 PixelShader(false, true, false);
    }
}

technique LightingAddColorModTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(false, true, false);
          PixelShader = compile ps_2_0 PixelShader(true, false, false);
    }
}

technique LightingModColorAddTexture
{
    pass P0
    {
          VertexShader = compile vs_2_0 VertexShader(true, false, false);
          PixelShader = compile ps_2_0 PixelShader(false, true, false);
    }
}

CodePlex Daily Summary for Sunday, May 31, 2009

May 31, 2009 by admin · Comment
Filed under: Xbox360 News 

CodePlex Daily Summary for Sunday, May 31, 2009

Most Popular Projects

Most Active Projects

New Releases

New Projects

CodePlex Daily Summary for Sunday, May 31, 2009

May 31, 2009 by admin · Comment
Filed under: Xbox360 News 

CodePlex Daily Summary for Sunday, May 31, 2009

Most Popular Projects

Most Active Projects

New Releases

New Projects

Next Page »