Permalink
Browse files

Point lights partially working

  • Loading branch information...
1 parent 28d4b90 commit 0c40ce710ce0ccdefc7d1f568a3df4a7b3c56a26 @liquidmetal committed Apr 5, 2012
Showing with 675 additions and 47 deletions.
  1. BIN ChipsChallenge.suo
  2. +14 −0 ChipsChallenge/ChipsChallenge/ChipsChallenge.csproj.Debug.cachefile
  3. +14 −0 ChipsChallenge/ChipsChallenge/obj/x86/Debug/ChipsChallenge.csproj.FileListAbsolute.txt
  4. +14 −0 ...enge/ChipsChallenge/obj/x86/Debug/cachefile-{E8D9DF49-E0A2-4624-8D0B-888775114165}-targetpath.txt
  5. +93 −1 ChipsChallenge/ChipsChallengeContent/ChipsChallengeContent.contentproj
  6. BIN ChipsChallenge/ChipsChallengeContent/floorTest_heigtmap.png
  7. +130 −4 ChipsChallenge/ChipsChallengeContent/obj/x86/Debug/ContentPipeline.xml
  8. +16 −8 ChipsChallenge/ChipsChallengeContent/shaders/DepthSprite.fx
  9. +9 −13 ChipsChallenge/ChipsChallengeContent/shaders/SimpleSprite.fx
  10. +15 −0 Engine/ChipEngine.cs
  11. +6 −0 Engine/Engine.csproj
  12. +31 −1 Engine/Entities/Entity.cs
  13. +25 −1 Engine/Entities/FloorTile.cs
  14. +153 −15 Engine/Renderer.cs
  15. +19 −1 Engine/World.cs
  16. BIN Engine/bin/x86/Debug/Engine.dll
  17. BIN Engine/bin/x86/Debug/Engine.pdb
  18. BIN Engine/obj/x86/Debug/Engine.dll
  19. BIN Engine/obj/x86/Debug/Engine.pdb
  20. +11 −1 LevelEditorXna/LevelEditorXna/FormRenderer.cs
  21. +14 −0 LevelEditorXna/LevelEditorXna/LevelEditorXna.csproj.Debug.cachefile
  22. +62 −2 LevelEditorXna/LevelEditorXna/MainForm.Designer.cs
  23. +21 −0 LevelEditorXna/LevelEditorXna/MainForm.cs
  24. BIN LevelEditorXna/LevelEditorXna/bin/x86/Debug/Engine.dll
  25. BIN LevelEditorXna/LevelEditorXna/bin/x86/Debug/Engine.pdb
  26. BIN LevelEditorXna/LevelEditorXna/bin/x86/Debug/LevelEditorXna.exe
  27. BIN LevelEditorXna/LevelEditorXna/bin/x86/Debug/LevelEditorXna.pdb
  28. BIN LevelEditorXna/LevelEditorXna/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
  29. +14 −0 LevelEditorXna/LevelEditorXna/obj/x86/Debug/LevelEditorXna.csproj.FileListAbsolute.txt
  30. BIN LevelEditorXna/LevelEditorXna/obj/x86/Debug/LevelEditorXna.exe
  31. BIN LevelEditorXna/LevelEditorXna/obj/x86/Debug/LevelEditorXna.pdb
  32. BIN LevelEditorXna/LevelEditorXna/obj/x86/Debug/ResolveAssemblyReference.cache
  33. +14 −0 ...rXna/LevelEditorXna/obj/x86/Debug/cachefile-{E8D9DF49-E0A2-4624-8D0B-888775114165}-targetpath.txt
View
Binary file not shown.
@@ -2,5 +2,19 @@ Content\wallA.xnb
Content\shaders\SimpleSprite.xnb
Content\shaders\DepthSprite.xnb
Content\shaders\ClearBuffers.xnb
+Content\shaders\ChannelRender.xnb
+Content\shaders\NormalSprite.xnb
+Content\shaders\PointLight.xnb
Content\floorTest.xnb
Content\floorTest_heightmap.xnb
+Content\sprites\test\teapot\dif.xnb
+Content\sprites\test\teapot\hgt.xnb
+Content\sprites\test\lightpos.xnb
+Content\sprites\test\lightbulb.xnb
+Content\sprites\test\teapot\nrm.xnb
+Content\sprites\test\cuboid\dif.xnb
+Content\sprites\test\cuboid\hgt.xnb
+Content\sprites\test\cuboid\nrm.xnb
+Content\sprites\test\cylinder\dif.xnb
+Content\sprites\test\cylinder\hgt.xnb
+Content\sprites\test\cylinder\nrm.xnb
@@ -10,3 +10,17 @@ D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\s
D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\shaders\DepthSprite.xnb
D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\shaders\ClearBuffers.xnb
D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\floorTest_heightmap.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\shaders\ChannelRender.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\cylinder\dif.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\cylinder\hgt.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\cylinder\nrm.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\teapot\hgt.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\teapot\nrm.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\teapot\dif.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\shaders\NormalSprite.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\lightpos.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\sprites\test\lightbulb.xnb
+D:\Projects\ChipsChallenge\ChipsChallenge\ChipsChallenge\bin\x86\Debug\Content\shaders\PointLight.xnb
+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
@@ -2,5 +2,19 @@ Content\wallA.xnb
Content\shaders\SimpleSprite.xnb
Content\shaders\DepthSprite.xnb
Content\shaders\ClearBuffers.xnb
+Content\shaders\ChannelRender.xnb
+Content\shaders\NormalSprite.xnb
+Content\shaders\PointLight.xnb
Content\floorTest.xnb
Content\floorTest_heightmap.xnb
+Content\sprites\test\teapot\dif.xnb
+Content\sprites\test\teapot\hgt.xnb
+Content\sprites\test\lightpos.xnb
+Content\sprites\test\lightbulb.xnb
+Content\sprites\test\teapot\nrm.xnb
+Content\sprites\test\cuboid\dif.xnb
+Content\sprites\test\cuboid\hgt.xnb
+Content\sprites\test\cuboid\nrm.xnb
+Content\sprites\test\cylinder\dif.xnb
+Content\sprites\test\cylinder\hgt.xnb
+Content\sprites\test\cylinder\nrm.xnb
@@ -73,12 +73,104 @@
<Importer>TextureImporter</Importer>
<Processor>TextureProcessor</Processor>
</Compile>
- <Compile Include="floorTest_heigtmap.png">
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="floorTest_heightmap.png">
<Name>floorTest_heightmap</Name>
<Importer>TextureImporter</Importer>
<Processor>TextureProcessor</Processor>
</Compile>
</ItemGroup>
+ <ItemGroup>
+ <Compile Include="shaders\ChannelRender.fx">
+ <Name>ChannelRender</Name>
+ <Importer>EffectImporter</Importer>
+ <Processor>EffectProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="sprites\test\teapot\dif.png">
+ <Name>dif</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="sprites\test\teapot\hgt.png">
+ <Name>hgt</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="shaders\NormalSprite.fx">
+ <Name>NormalSprite</Name>
+ <Importer>EffectImporter</Importer>
+ <Processor>EffectProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="sprites\test\lightpos.png">
+ <Name>lightpos</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="sprites\test\lightbulb.png">
+ <Name>lightbulb</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="shaders\PointLight.fx">
+ <Name>PointLight</Name>
+ <Importer>EffectImporter</Importer>
+ <Processor>EffectProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="sprites\test\teapot\nrm.png">
+ <Name>nrm</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="sprites\test\cuboid\dif.png">
+ <Name>dif</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ <Compile Include="sprites\test\cuboid\hgt.png">
+ <Name>hgt</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ <Compile Include="sprites\test\cuboid\nrm.png">
+ <Name>nrm</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="sprites\test\cylinder\dif.png">
+ <Name>dif</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ <Compile Include="sprites\test\cylinder\hgt.png">
+ <Name>hgt</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ <Compile Include="sprites\test\cylinder\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.
Deleted file not rendered
@@ -16,7 +16,7 @@
<Processor>EffectProcessor</Processor>
<Options>None</Options>
<Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\shaders\SimpleSprite.xnb</Output>
- <Time>2012-04-01T19:17:20.025949-07:00</Time>
+ <Time>2012-04-04T13:15:34.7173167-07:00</Time>
</Item>
<Item>
<Source>shaders\DepthSprite.fx</Source>
@@ -25,7 +25,7 @@
<Processor>EffectProcessor</Processor>
<Options>None</Options>
<Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\shaders\DepthSprite.xnb</Output>
- <Time>2012-04-01T22:32:07.8594738-07:00</Time>
+ <Time>2012-04-04T20:08:43.4561515-07:00</Time>
</Item>
<Item>
<Source>shaders\ClearBuffers.fx</Source>
@@ -37,6 +37,33 @@
<Time>2012-04-01T11:44:21.6014321-07:00</Time>
</Item>
<Item>
+ <Source>shaders\ChannelRender.fx</Source>
+ <Name>shaders\ChannelRender</Name>
+ <Importer>EffectImporter</Importer>
+ <Processor>EffectProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\shaders\ChannelRender.xnb</Output>
+ <Time>2012-04-02T07:47:00.1968638-07:00</Time>
+ </Item>
+ <Item>
+ <Source>shaders\NormalSprite.fx</Source>
+ <Name>shaders\NormalSprite</Name>
+ <Importer>EffectImporter</Importer>
+ <Processor>EffectProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\shaders\NormalSprite.xnb</Output>
+ <Time>2012-04-04T12:59:08.2328931-07:00</Time>
+ </Item>
+ <Item>
+ <Source>shaders\PointLight.fx</Source>
+ <Name>shaders\PointLight</Name>
+ <Importer>EffectImporter</Importer>
+ <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>
+ </Item>
+ <Item>
<Source>floorTest.png</Source>
<Name>floorTest</Name>
<Importer>TextureImporter</Importer>
@@ -46,13 +73,112 @@
<Time>2012-04-01T13:44:49.1908265-07:00</Time>
</Item>
<Item>
- <Source>floorTest_heigtmap.png</Source>
+ <Source>floorTest_heightmap.png</Source>
<Name>floorTest_heightmap</Name>
<Importer>TextureImporter</Importer>
<Processor>TextureProcessor</Processor>
<Options>None</Options>
<Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\floorTest_heightmap.xnb</Output>
- <Time>2012-04-01T13:44:49.1928266-07:00</Time>
+ <Time>2012-04-02T07:16:22.8447733-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\teapot\dif.png</Source>
+ <Name>sprites\test\teapot\dif</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\teapot\dif.xnb</Output>
+ <Time>2012-04-04T12:15:29.5561133-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\teapot\hgt.png</Source>
+ <Name>sprites\test\teapot\hgt</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\teapot\hgt.xnb</Output>
+ <Time>2012-04-04T12:21:49.6658544-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\lightpos.png</Source>
+ <Name>sprites\test\lightpos</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\lightpos.xnb</Output>
+ <Time>2012-04-04T13:44:05.9641945-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\lightbulb.png</Source>
+ <Name>sprites\test\lightbulb</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\lightbulb.xnb</Output>
+ <Time>2012-04-04T13:57:06.2688253-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\teapot\nrm.png</Source>
+ <Name>sprites\test\teapot\nrm</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\teapot\nrm.xnb</Output>
+ <Time>2012-04-04T23:04:12.5553815-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\cuboid\dif.png</Source>
+ <Name>sprites\test\cuboid\dif</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\cuboid\dif.xnb</Output>
+ <Time>2012-04-04T16:39:10.1189978-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\cuboid\hgt.png</Source>
+ <Name>sprites\test\cuboid\hgt</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\cuboid\hgt.xnb</Output>
+ <Time>2012-04-04T19:55:03.4302487-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\cuboid\nrm.png</Source>
+ <Name>sprites\test\cuboid\nrm</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\cuboid\nrm.xnb</Output>
+ <Time>2012-04-04T18:58:08.3749187-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\cylinder\dif.png</Source>
+ <Name>sprites\test\cylinder\dif</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <Output>D:\Projects\ChipsChallenge\LevelEditorXna\LevelEditorXna\bin\x86\Debug\Content\sprites\test\cylinder\dif.xnb</Output>
+ <Time>2012-04-04T23:22:02.4895783-07:00</Time>
+ </Item>
+ <Item>
+ <Source>sprites\test\cylinder\hgt.png</Source>
+ <Name>sprites\test\cylinder\hgt</Name>
+ <Importer>TextureImporter</Importer>
+ <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>
+ </Item>
+ <Item>
+ <Source>sprites\test\cylinder\nrm.png</Source>
+ <Name>sprites\test\cylinder\nrm</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <Options>None</Options>
+ <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>
<BuildSuccessful>true</BuildSuccessful>
<Settings>
@@ -4,10 +4,17 @@ sampler heightBuffer : register(s1);
float2 position;
float2 bufferSize;
float2 texSize;
+float z;
-float4 PixelShaderFunction(float2 uv : TEXCOORD0, float4 col : COLOR0) : COLOR0
+struct PSO
{
- float4 ret;
+ float4 color : COLOR0;
+ float4 mask : COLOR1;
+};
+
+PSO PixelShaderFunction(float2 uv : TEXCOORD0, float4 col : COLOR0)
+{
+ PSO ret;
float2 shifted;
float2 shiftedUnnormalized;
@@ -24,21 +31,22 @@ float4 PixelShaderFunction(float2 uv : TEXCOORD0, float4 col : COLOR0) : COLOR0
bufferPos = float3(shiftedUnnormalized.x, shiftedUnnormalized.y+bufferColor.r, bufferColor.r);
texturePos = float3(uv.x*texSize.x, uv.y*texSize.y+currentColor.r, currentColor.r);
- float pyth;
- float thresh;
+ //float pyth;
+ //float thresh;
//thresh = 2*(texturePos.z-bufferPos.z)*(texturePos.z-bufferPos.z);
//pyth = (texturePos.z-bufferPos.z)*(texturePos.z-bufferPos.z) + ((texturePos.y+position.y)-bufferPos.y)*((texturePos.y+position.y)-bufferPos.y);
if(bufferPos.y<=texturePos.y+position.y)
{
- ret = currentColor;
- ret.a = 0;
+ ret.color = currentColor;
+ ret.color.a = 1;
+ ret.mask = float4(1,1,1,1);
}
else
{
- ret = bufferColor;
- ret.a = 1;
+ ret.color = float4(0,0,0,0);//bufferColor;
+ ret.mask = float4(0,0,0,0);
}
Oops, something went wrong.

0 comments on commit 0c40ce7

Please sign in to comment.