Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


[DX9] many lights: registers VS Volume Texture


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 user88   Members   -  Reputation: 268

Like
0Likes
Like

Posted 07 February 2014 - 03:35 AM

Hi,

 

I want to expand maximum lights capability in my 3D engine. The DX9, forward rendering is used there. The lights pass to shader as array of corresponding shader structs, located in registers memory. So, registers memory is restriction for max lights.

 

Could anybody tell me tell whether the performance will be good enough when i will hold lights array in Volume Texture? I mean in compare to registers memory..

 

Thanks for your help!



Sponsor:

#2 Tispe   Members   -  Reputation: 1039

Like
1Likes
Like

Posted 07 February 2014 - 06:41 AM

I think that the bandwidth usage and overhead of transferring a few kilobytes to the GPU is no problem. You can use Vertex Texture Fetch in the vertex shader to lookup your lights array.

 

Only when you want each light to cast shadows will you notice performance issues.



#3 user88   Members   -  Reputation: 268

Like
0Likes
Like

Posted 07 February 2014 - 07:53 AM

thank you for reply, Tispe.

 

 
I will take your post into account. Before i started to do anything, I want to hear the point views of people concerning topic question. So, please tell me if somebody has different point of view.
 

 

 

You can use Vertex Texture Fetch in the vertex shader to lookup your lights array.

Nice advice! Didn't know about such feature.

 

 

Only when you want each light to cast shadows will you notice performance issues.

 

Only direct lighting calculations are there..



#4 Hodgman   Moderators   -  Reputation: 31214

Like
0Likes
Like

Posted 07 February 2014 - 03:46 PM

Fetching a value from a texture will be slower than fetching it from a constant/register. The latter hardware is optimized for predictable data access, where it assumes that every pixel/vertex will read every register, in the same order. The former hardware is designed assuming that each pixel/vertex will read different texels, and that not every texel in the source image will be used.

If you want to use VTF on D3D9, you have to check the caps to see if it's supported, and query whether each texture format you want to use with VTF is also supported. Most D3D9 era cards with VTF support will only work with four-channel 16F (half float) format.

Does it have to be a volume texture, not 1D or 2D? What's your actual usage idea?

#5 cozzie   Members   -  Reputation: 1660

Like
0Likes
Like

Posted 07 February 2014 - 05:35 PM

It might also be good to define what you mean with 'many lights'. Does this mean many lights in total in the scene, or many lights affecting a single renderable?

If it's the first, you could optimize by having relative small renderables ('submeshes') and then take for example the 8 lights that most affect that renderable. In most situations having more then 8 lights affecting one renderable, the difference in result is quite small.


Edited by cozzie, 07 February 2014 - 05:36 PM.


#6 alek314??   Members   -  Reputation: 303

Like
0Likes
Like

Posted 10 February 2014 - 06:56 PM

It might also be good to define what you mean with 'many lights'. Does this mean many lights in total in the scene, or many lights affecting a single renderable?

If it's the first, you could optimize by having relative small renderables ('submeshes') and then take for example the 8 lights that most affect that renderable. In most situations having more then 8 lights affecting one renderable, the difference in result is quite small.

With Vertex texture fetch, one can render the same mesh using instancing. 

As for D3D9, I think it's for people with new graphic card but stuck with Windows XP.

One can also fall back to Doom3 style rendering,which use additive blending with multiple pass.



#7 mhagain   Crossbones+   -  Reputation: 8175

Like
0Likes
Like

Posted 10 February 2014 - 11:44 PM

One can also fall back to Doom3 style rendering,which use additive blending with multiple pass.

 

This could also be done using instancing, where each light is defined by per-instance data.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS