Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

Its exposed to lua - see the script i posted in the link above. Whether or not its exposed to the game launcher app depends on what build the launcher is made from and if it was exposed in that version.

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

LE / 3DWS / BMX / Hexagon

macklebee's channel

Posted

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?

Posted

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

Posted

It seems:

 

36

45

60

110

 

Are the ranges I need to set to get the best look. I have no idea how any of this works but thanks for the script to help me see what gives what visual Mac!

  • 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.

×
×
  • Create New...