Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8370113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:50:06+00:00 2026-06-09T13:50:06+00:00

I have a lighting system in my xna game that loops through each light,

  • 0

I have a lighting system in my xna game that loops through each light, and adds these lights to a final light map, which contains all the lights.

The process to create these lights involves many functions that have to do with the graphics device, such as using effects / shaders and drawing to render targets, and using graphics.device.clear to clear the render target, etc

So my question is, would it be possible to multi thread each light? Or would this not be possible because there is only 1 graphics device, and only 1 thread can use it at a time? If it is possible, would it improve performance?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:50:07+00:00Added an answer on June 9, 2026 at 1:50 pm

    Basically no. The GraphicsDevice in XNA is single-threaded for rendering. You can send resources (textures, vertex buffers, etc) to the GPU from multiple threads. But you can only call Draw (and other rendering functions like Present) from your main thread.

    I have heard of people having success doing rendering-type-things from multiple threads with the appropriate locking in place. But that seems like “bad voodoo”. As the linked post says: “the XNA Framework documentation doesn’t make any promises here“. Not to mention: even getting the locking right is tricky.

    I’m not really sure about making multiple graphics devices – I’ve not tried it myself. I think that it is possible, but that you can’t share resources between the devices – making it fairly useless. Probably not worth the effort.

    As jalf mentioned in a comment on your question – once you get to the GPU everything is handled in parallel already. So this would only be useful if you are CPU limited due to hitting the batch limit (because almost everything that isn’t your batches can be moved to another thread). And in that case there are many optimisations to consider first to reduce the number of batches – before trying a crazy scheme like this. (And you have measured your performance, right?)

    It sounds like what you might be trying to do is render a fairly complicated scene to a render target in the background, and spreading the load across many frames. In that case – if performance requirements dictate it – you could perhaps render across multiple frames, on the main thread, scheduling it manually. Don’t forget to set RenderTargetUsage.PreserveContents so it doesn’t get cleared each time you put it on the graphics device.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a normal map in my OpenGL game engine and I realized that
Is it possible to enable per-pixel lighting (so that I can have nice specular
Couple of quick questions. I have a DMX king USB lighting controller that I'm
I have a texture with transparency (the white triangle with that lighting information), and
I have an RGB image in MATLAB, and I want to loop through each
I have a model that looks good with lighting, but in that model I
are there any light 3d iphone libraries that have: Physics ( ragdoll physics )
I am attempting to replace the Canvas-based rendering system that I already have with
I have created a custom listview that is populated using a row.xml file. Each
I have a website that loads lightning fast in Firefox, Chrome, and other browsers,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.