Permalink
Browse files

Fixed point lights - needs more testing

  • Loading branch information...
1 parent e463e6a commit 9621ba97e2ec038f9ddedfe83836d51ee2ed9381 @liquidmetal committed Apr 10, 2012
Showing with 200 additions and 14 deletions.
  1. +6 −0 ChipsChallenge/ChipsChallenge/ChipsChallenge.csproj.Debug.cachefile
  2. +6 −0 ChipsChallenge/ChipsChallenge/obj/x86/Debug/ChipsChallenge.csproj.FileListAbsolute.txt
  3. +6 −0 ...enge/ChipsChallenge/obj/x86/Debug/cachefile-{E8D9DF49-E0A2-4624-8D0B-888775114165}-targetpath.txt
  4. +34 −0 ChipsChallenge/ChipsChallengeContent/ChipsChallengeContent.contentproj
  5. +56 −2 ChipsChallenge/ChipsChallengeContent/obj/x86/Debug/ContentPipeline.xml
  6. +2 −0 Engine/Engine.csproj
  7. +24 −4 Engine/Renderer.cs
  8. BIN Engine/bin/x86/Debug/Engine.dll
  9. BIN Engine/bin/x86/Debug/Engine.pdb
  10. BIN Engine/obj/x86/Debug/Engine.dll
  11. BIN Engine/obj/x86/Debug/Engine.pdb
  12. +6 −0 LevelEditorXna/LevelEditorXna/LevelEditorXna.csproj.Debug.cachefile
  13. +38 −8 LevelEditorXna/LevelEditorXna/MainForm.Designer.cs
  14. +10 −0 LevelEditorXna/LevelEditorXna/MainForm.cs
  15. BIN LevelEditorXna/LevelEditorXna/bin/x86/Debug/Engine.dll
  16. BIN LevelEditorXna/LevelEditorXna/bin/x86/Debug/Engine.pdb
  17. BIN LevelEditorXna/LevelEditorXna/bin/x86/Debug/LevelEditorXna.exe
  18. BIN LevelEditorXna/LevelEditorXna/bin/x86/Debug/LevelEditorXna.pdb
  19. BIN LevelEditorXna/LevelEditorXna/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
  20. +6 −0 LevelEditorXna/LevelEditorXna/obj/x86/Debug/LevelEditorXna.csproj.FileListAbsolute.txt
  21. BIN LevelEditorXna/LevelEditorXna/obj/x86/Debug/LevelEditorXna.exe
  22. BIN LevelEditorXna/LevelEditorXna/obj/x86/Debug/LevelEditorXna.pdb
  23. BIN LevelEditorXna/LevelEditorXna/obj/x86/Debug/ResolveAssemblyReference.cache
  24. +6 −0 ...rXna/LevelEditorXna/obj/x86/Debug/cachefile-{E8D9DF49-E0A2-4624-8D0B-888775114165}-targetpath.txt
  25. BIN assets/template.max
  26. BIN assets/test/Cylinder/dif.png
  27. BIN assets/test/Cylinder/hgt.png
  28. BIN assets/test/Cylinder/iso-cylinder.max
  29. BIN assets/test/Cylinder/nrm.png
  30. BIN assets/test/cuboid/dif.png
  31. BIN assets/test/cuboid/hgt.png
  32. BIN assets/test/cuboid/nrm.png
  33. BIN assets/test/iso-cylinder.max
  34. BIN assets/test/teapot/iso-teapot.max
  35. BIN assets/test/teapot/teapot.PSD
  36. BIN assets/test/teapot/teapot.rpf
  37. BIN assets/test/teapot/teapot_hgt.png
  38. BIN assets/test/teapot/teapot_nrm.png
@@ -18,3 +18,9 @@ Content\sprites\test\cuboid\nrm.xnb
Content\sprites\test\cylinder\dif.xnb
Content\sprites\test\cylinder\hgt.xnb
Content\sprites\test\cylinder\nrm.xnb
+Content\sprites\buildings\houseA\dif.xnb
+Content\sprites\buildings\houseA\hgt.xnb
+Content\sprites\buildings\houseA\nrm.xnb
+Content\sprites\test\plane\dif.xnb
+Content\sprites\test\plane\hgt.xnb
+Content\sprites\test\plane\nrm.xnb
@@ -24,3 +24,9 @@ D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\s
D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\cuboid\dif.xnb
D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\cuboid\hgt.xnb
D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\cuboid\nrm.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\buildings\houseA\dif.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\buildings\houseA\hgt.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\buildings\houseA\nrm.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\plane\dif.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\plane\hgt.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\plane\nrm.xnb
@@ -18,3 +18,9 @@ Content\sprites\test\cuboid\nrm.xnb
Content\sprites\test\cylinder\dif.xnb
Content\sprites\test\cylinder\hgt.xnb
Content\sprites\test\cylinder\nrm.xnb
+Content\sprites\buildings\houseA\dif.xnb
+Content\sprites\buildings\houseA\hgt.xnb
+Content\sprites\buildings\houseA\nrm.xnb
+Content\sprites\test\plane\dif.xnb
+Content\sprites\test\plane\hgt.xnb
+Content\sprites\test\plane\nrm.xnb
@@ -171,6 +171,40 @@
<Processor>TextureProcessor</Processor>
</Compile>
</ItemGroup>
+ <ItemGroup>
+ <Compile Include="sprites\buildings\houseA\dif.png">
+ <Name>dif</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ <Compile Include="sprites\buildings\houseA\hgt.png">
+ <Name>hgt</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ <Compile Include="sprites\buildings\houseA\nrm.png">
+ <Name>nrm</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="sprites\test\plane\dif.png">
+ <Name>dif</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ <Compile Include="sprites\test\plane\hgt.png">
+ <Name>hgt</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ <Compile Include="sprites\test\plane\nrm.png">
+ <Name>nrm</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -61,7 +61,7 @@
<Processor>EffectProcessor</Processor>
<Options>None</Options>
<Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\shaders\PointLight.xnb</Output>
- <Time>2012-04-04T21:52:02.0936933-07:00</Time>
+ <Time>2012-04-09T22:08:40.298994-07:00</Time>
</Item>
<Item>
<Source>floorTest.png</Source>
@@ -169,7 +169,7 @@
<Processor>TextureProcessor</Processor>
<Options>None</Options>
<Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\cylinder\hgt.xnb</Output>
- <Time>2012-04-04T23:28:15.6109196-07:00</Time>
+ <Time>2012-04-05T20:11:44.8783256-07:00</Time>
</Item>
<Item>
<Source>sprites\test\cylinder\nrm.png</Source>
@@ -180,6 +180,60 @@
<Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\cylinder\nrm.xnb</Output>
<Time>2012-04-04T23:22:02.4915784-07:00</Time>
</Item>
+ <Item>
+ <Source>sprites\buildings\houseA\dif.png</Source>
+ <Name>sprites\buildings\houseA\dif</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\buildings\houseA\dif.xnb</Output>
+ <Time>2012-04-05T21:40:47.5989117-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\buildings\houseA\hgt.png</Source>
+ <Name>sprites\buildings\houseA\hgt</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\buildings\houseA\hgt.xnb</Output>
+ <Time>2012-04-05T21:40:47.6009118-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\buildings\houseA\nrm.png</Source>
+ <Name>sprites\buildings\houseA\nrm</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\buildings\houseA\nrm.xnb</Output>
+ <Time>2012-04-09T22:30:07.5926229-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\plane\dif.png</Source>
+ <Name>sprites\test\plane\dif</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\plane\dif.xnb</Output>
+ <Time>2012-04-07T12:56:58.3628569-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\plane\hgt.png</Source>
+ <Name>sprites\test\plane\hgt</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\plane\hgt.xnb</Output>
+ <Time>2012-04-07T12:56:58.363857-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\plane\nrm.png</Source>
+ <Name>sprites\test\plane\nrm</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\plane\nrm.xnb</Output>
+ <Time>2012-04-09T22:03:06.4008961-07:00</Time>
+ </Item>
<BuildSuccessful>true</BuildSuccessful>
<Settings>
<TargetPlatform>Windows</TargetPlatform>
View
@@ -93,12 +93,14 @@
</ItemGroup>
<ItemGroup>
<Compile Include="ChipEngine.cs" />
+ <Compile Include="Entities\Buildings\HouseA.cs" />
<Compile Include="Entities\Entity.cs" />
<Compile Include="Entities\FloorTile.cs" />
<Compile Include="Entities\Lights\Light.cs" />
<Compile Include="Entities\Lights\PointLight.cs" />
<Compile Include="Entities\Test\Cuboid.cs" />
<Compile Include="Entities\Test\Cylinder.cs" />
+ <Compile Include="Entities\Test\Plane.cs" />
<Compile Include="Entities\Test\Teapot.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Renderer.cs" />
View
@@ -16,6 +16,8 @@
namespace Engine
{
+ public enum RenderSceneType { Diffuse, Height, Normal };
+
public class Renderer
{
AssetManager assetManager = null;
@@ -32,6 +34,7 @@ public class Renderer
private RenderTarget2D temp;
private bool m_bDrawLights;
+ private RenderSceneType m_rstType; // Which pass to render out
public Renderer(AssetManager tex, GraphicsDevice device)
{
@@ -48,6 +51,11 @@ public void DrawLights(bool state)
m_bDrawLights = state;
}
+ public void SetRenderSceneType(RenderSceneType rst)
+ {
+ m_rstType = rst;
+ }
+
private void SetupRenderTargets()
{
//graphicsDevice.SetRenderTargets(m_rtDif, m_rtDepthStencil);
@@ -269,17 +277,29 @@ public bool RenderWorld(World world)
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
spriteBatch.Draw(lightPos, pos, light.Color);
- spriteBatch.Draw(lightBulb, new Vector2(pos.X, pos.Y - light.Z), light.Color);
+ spriteBatch.Draw(lightBulb, new Vector2(pos.X, pos.Y - light.Z/1.414f), light.Color);
spriteBatch.End();
}
}
graphicsDevice.SetRenderTarget(null);
graphicsDevice.Clear(Color.Transparent);
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
- //channel.Parameters["channel"].SetValue(3);
- //channel.Techniques[0].Passes[0].Apply();
- spriteBatch.Draw(m_rtDif2, Vector2.Zero, Color.White);
+
+ switch(m_rstType)
+ {
+ case RenderSceneType.Diffuse:
+ spriteBatch.Draw(m_rtDif2, Vector2.Zero, Color.White);
+ break;
+
+ case RenderSceneType.Height:
+ spriteBatch.Draw(m_rtDepthStencil, Vector2.Zero, Color.White);
+ break;
+
+ case RenderSceneType.Normal:
+ spriteBatch.Draw(m_rtNormal, Vector2.Zero, Color.White);
+ break;
+ }
spriteBatch.End();
return true;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -18,3 +18,9 @@ Content\sprites\test\cuboid\nrm.xnb
Content\sprites\test\cylinder\dif.xnb
Content\sprites\test\cylinder\hgt.xnb
Content\sprites\test\cylinder\nrm.xnb
+Content\sprites\buildings\houseA\dif.xnb
+Content\sprites\buildings\houseA\hgt.xnb
+Content\sprites\buildings\houseA\nrm.xnb
+Content\sprites\test\plane\dif.xnb
+Content\sprites\test\plane\hgt.xnb
+Content\sprites\test\plane\nrm.xnb

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -173,5 +173,15 @@ private void mnuCreateCuboid_Click(object sender, EventArgs e)
{
currentWorld.AddEntity(new Engine.Entities.Test.Cuboid());
}
+
+ private void houseAToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ currentWorld.AddEntity(new Engine.Entities.Buildings.HouseA());
+ }
+
+ private void planeToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ currentWorld.AddEntity(new Engine.Entities.Test.Plane());
+ }
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -29,3 +29,9 @@ D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\s
D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\cuboid\dif.xnb
D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\cuboid\hgt.xnb
D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\cuboid\nrm.xnb
+D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\buildings\houseA\dif.xnb
+D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\buildings\houseA\hgt.xnb
+D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\buildings\houseA\nrm.xnb
+D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\plane\dif.xnb
+D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\plane\hgt.xnb
+D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\plane\nrm.xnb
Binary file not shown.
Binary file not shown.
@@ -18,3 +18,9 @@ Content\sprites\test\cuboid\nrm.xnb
Content\sprites\test\cylinder\dif.xnb
Content\sprites\test\cylinder\hgt.xnb
Content\sprites\test\cylinder\nrm.xnb
+Content\sprites\buildings\houseA\dif.xnb
+Content\sprites\buildings\houseA\hgt.xnb
+Content\sprites\buildings\houseA\nrm.xnb
+Content\sprites\test\plane\dif.xnb
+Content\sprites\test\plane\hgt.xnb
+Content\sprites\test\plane\nrm.xnb
View
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9621ba9

Please sign in to comment.