Jump to content

Very low camera fov and shadows


Rick
 Share

Recommended Posts

When trying to get a more isometric style I put the camera's fov to about 25 or so. I rotate the camera 45 degrees on x & y axis and move it back. Because the fov needs to be around 25 to get the isometric look, I have to zoom the camera way back (about -40). I think however this is out of shadow drawing range so there are no shadows which kills the effect.

 

How can I make shadows stay no matter what or increase the view range of them in the editor?

Link to comment
Share on other sites

This is a tricky situation because cascaded shadow maps are sort of at odds with orthographic rendering. The whole idea of CSM is greater resolution near the camera, but without a perspective projection that makes no sense.

 

There is a DirectionalLight class member you can set in the engine that controls the shadow map stage ranges:

float shadowstagerange[4]

 

  • Confused 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

You may have to adjust the stages' linear offset as well if you modify the stage's range. See here for a script that allows for modifying the linear offset in game to help remove artifacts: http://www.leadwerks.com/werkspace/topic/14985-changing-shadow-resolution/#entry101390

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

I see. So what's the idea here? I'm not sure how this shadow stuff works. I set:

 

self.entity.shadowstagerange[3] = 1000

 

and still can't see the shadow. What are these ranges in? meters? Why 4 ranges? If you had to guess what values would I set each to in order to see the shadows because I'm randomly setting stuff and can't see any shadows?

Link to comment
Share on other sites

You have to look at each stage with ranges in meters. Try this script attached to your directional light to see the affect of changing the stages' ranges:

 
function Script:Start()
	self.value = 5
end

function Script:UpdateWorld()
	local window = Window:GetCurrent()
	if window:KeyHit(Key.Up)==true then
		self.entity.shadowstagerange[0] = self.entity.shadowstagerange[0] + self.value
		self.entity.shadowstagerange[1] = self.entity.shadowstagerange[1] + self.value
		self.entity.shadowstagerange[2] = self.entity.shadowstagerange[2] + self.value
		self.entity.shadowstagerange[3] = self.entity.shadowstagerange[3] + self.value
	end
	if window:KeyHit(Key.Down)==true then
		self.entity.shadowstagerange[0] = self.entity.shadowstagerange[0] - self.value
		self.entity.shadowstagerange[1] = self.entity.shadowstagerange[1] - self.value
		self.entity.shadowstagerange[2] = self.entity.shadowstagerange[2] - self.value
		self.entity.shadowstagerange[3] = self.entity.shadowstagerange[3] - self.value
	end
end

function Script:PostRender(context)
	context:SetBlendMode(1)
	for i = 0, 3 do
		context:DrawText("Range: "..self.entity.shadowstagerange[i],2,i*22)
	end
	context:SetBlendMode(0)
end

 

  • Like 2
  • Upvote 2

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...