Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kosmonaut3d committed Feb 7, 2017
1 parent de23752 commit 8c1dbbf
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ float2 CalculatePOM(float3 WorldPosition, float3x3 TangentSpace, float2 texCoord
// depth of current layer
float currentLayerDepth = 0.0;

float2 P = viewDir.xy/(max(viewDir.z, 0.4f)) * abs(height_scale);
float2 P = viewDir.xy/(max(viewDir.z, 0.2f)) * abs(height_scale);
float2 deltaTexCoords = P / numLayers;

float f1 = saturate(sign(height_scale));
Expand Down
2 changes: 1 addition & 1 deletion HelperSuite/Game1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Game1()
_screenManager = new ScreenManager();

//Set up graphics properties, no vsync, no framelock
_graphics.SynchronizeWithVerticalRetrace = true;
_graphics.SynchronizeWithVerticalRetrace = false;
IsFixedTimeStep = true;
//TargetElapsedTime = TimeSpan.FromMilliseconds(100);

Expand Down
2 changes: 1 addition & 1 deletion HelperSuite/HelperSuite/Static/GameSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static class GameSettings
public static bool ao_UseStencil = true;
public static bool ao_UseBlur = true;
public static bool ao_HalfRes = true;
public static float pomScale = 0.05f;
public static float pomScale = 0.3f;
public static bool r_UsePOM = false;
public static bool r_POMCutoff = true;
public static float r_POMQuality = 1;
Expand Down
2 changes: 1 addition & 1 deletion HelperSuite/Logic/GUILogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public void Initialize(MainLogic mainLogic)
_pomBlock =
new GUITextBlock(Vector2.Zero, new Vector2(200, 25), "Bump Scale: " + GameSettings.pomScale,
GUIRenderer.MonospaceFont, Color.Gray, Color.White));
parallaxList.AddElement(new GuiSliderFloat(Vector2.Zero, new Vector2(200, 25), -0.5f, 0.5f, Color.Gray, Color.Black)
parallaxList.AddElement(new GuiSliderFloat(Vector2.Zero, new Vector2(200, 25), -0.7f, 0.7f, Color.Gray, Color.Black)
{
SliderField = typeof(GameSettings).GetField("pomScale"),
SliderValue = (float)typeof(GameSettings).GetField("pomScale").GetValue(null)
Expand Down
1 change: 1 addition & 0 deletions HelperSuite/Logic/MainLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ private void MouseEvents(Camera camera, ref Vector3 position)
var phi = Math.Atan2(y, x);

phi += (Input.mouseState.X - Input.mouseLastState.X)/60.0f;
if(!Input.IsKeyDown(Keys.LeftControl))
tau = (tau + (Input.mouseState.Y - Input.mouseLastState.Y)/100.0f).Clamp(0.01f, Math.PI - 0.1f);

//Convert back
Expand Down
4 changes: 3 additions & 1 deletion HelperSuite/Renderer/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Renderer
private Matrix _projection;
private Matrix _viewProjection;
private bool _viewProjectionHasChanged;
private BoundingFrustum _boundingFrustum;

private ThreadSafeContentManager _contentManager;

Expand Down Expand Up @@ -66,6 +67,8 @@ public void Initialize(GraphicsDevice graphicsDevice)

YupOrientation = Matrix.CreateRotationX((float) (Math.PI/2));

_boundingFrustum = new BoundingFrustum(Matrix.Identity);

UpdateRenderTargets();

_stencilWriteOnly = new DepthStencilState()
Expand Down Expand Up @@ -387,7 +390,6 @@ private void UpdateViewProjection(Camera camera)
_viewProjection = _view * _projection;
}

BoundingFrustum _boundingFrustum = new BoundingFrustum(Matrix.Identity);
_boundingFrustum.Matrix = _viewProjection;
ComputeFrustumCorners(_boundingFrustum);

Expand Down
3 changes: 3 additions & 0 deletions ModelViewer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MGSkinnedAnimationPipeline", "..\OceanRender\MGSkinnedAnimationPipeline\MGSkinnedAnimationPipeline.csproj", "{D19F0DBF-A3DE-4FC3-BB2A-F6AEBD8C50C7}"
EndProject
Global
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Expand Down

0 comments on commit 8c1dbbf

Please sign in to comment.