Rick Posted November 22, 2016 Share Posted November 22, 2016 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? Quote Link to comment Share on other sites More sharing options...
Josh Posted November 22, 2016 Share Posted November 22, 2016 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] 1 Quote 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 More sharing options...
macklebee Posted November 22, 2016 Share Posted November 22, 2016 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 Quote 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 More sharing options...
Rick Posted November 22, 2016 Author Share Posted November 22, 2016 @Josh So is that exposed to Lua by chance? Was hoping to have this play in the game launcher app. Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 22, 2016 Share Posted November 22, 2016 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. Quote 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 More sharing options...
Rick Posted November 22, 2016 Author Share Posted November 22, 2016 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? Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 22, 2016 Share Posted November 22, 2016 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 2 2 Quote 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 More sharing options...
Rick Posted November 22, 2016 Author Share Posted November 22, 2016 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! Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 22, 2016 Share Posted November 22, 2016 Are you asking what CSMs are? https://msdn.microsoft.com/en-us/library/windows/desktop/ee416307(v=vs.85).aspx Quote 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 More sharing options...
Yue Posted June 17, 2019 Share Posted June 17, 2019 @Josh @Rick @macklebee Quote Link to comment Share on other sites More sharing options...
Daemoc Posted June 17, 2019 Share Posted June 17, 2019 How fortuitous. I just ran into this issue myself. Thanks for the script mac! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.