Is there any way to view shadow map in Urho? I tried to render shadow map texture on UI using Sprite, but I got only white texture.
Here’s my result, white rectangle in bottom left is shadow map sprite:
Here’s the code:
[code]Renderer* renderer = GetSubsystem();
Light* mainLight = scene_->GetChild(“MainLight”)->GetComponent();
Camera* mainCamera = scene_->GetChild(“MainCamera”)->GetComponent();
Texture* shadow = renderer->GetShadowMap(mainLight, mainCamera, 1024, 768);
UI* ui = GetSubsystem();
Sprite* debugSprite = ui->GetRoot()->CreateChild();
debugSprite->SetTexture(shadow);
int textureWidth = shadow->GetWidth();
int textureHeight = shadow->GetHeight();
debugSprite->SetScale(256.0f / textureWidth);
debugSprite->SetSize(textureWidth, textureHeight);
debugSprite->SetHotSpot(0, textureHeight);
debugSprite->SetAlignment(HA_LEFT, VA_BOTTOM);
debugSprite->SetPriority(-100);[/code]
Am I doing something wrong?