Jump to content

Recommended Posts

Posted

Probably a very simple question but if I have Light* light = DirectionalLight::Create(), how can I access shadowstagerange[4] via C++ code?  I have some shadows acting weird and I think this could help, per Josh's suggestion here: https://www.leadwerks.com/community/topic/12573-directional-light-cast-shadow-distance-and-camera-zoom-important-issue/?do=findComment&comment=90577

If anyone's curious, this is what I'm looking at (shadow cutting off suddenly in a side-scroller).  I already tried camera->SetMultisampleMode(32) and world->SetLightQuality(2) and setting various light ranges but nothing helped.

Moving the camera left or right moves that edge left or right.  If I move the camera closer, it doesn't change anything but if I move it back, the shadow gets shorter, so it's tied to the camera and/or light somehow.

shadow.thumb.jpg.078781c910dacac4a05cf98d009858c3.jpg

  • Confused 1
Posted

Thank you.  I switched my initial code to DirectionalLight* light = DirectionalLight::Create() and it allowed me to access that member.  I suspect there's a way to make it do it just with Light *light but that's above my head right now.  shadowstagerange[0] was 6.0 by default and once I bumped that up, the shadow stretched further out.

Code for anyone curious:

DirectionalLight* light = DirectionalLight::Create();
light->SetRotation(35, 35, 0);
printf("Default [0] value: %f\n\n",light->shadowstagerange[0]);
light->shadowstagerange[0]=40;

 

  • Like 1

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