![]() |
|
Greyscale-Filter is too slow. How to improve performance? |
Marcello
Member #1,860
January 2002
![]() |
Wouldn't a hardware-accelerated grayscale filter require programmable pixel shader? Marcello |
Krzysztof Kluczek
Member #4,191
January 2004
![]() |
Quote: Wouldn't a hardware-accelerated grayscale filter require programmable pixel shader?
No. Texture combiners with dot product support would be enough. ________ |
A J
Member #3,025
December 2002
![]() |
Quote: Someone programmed a realtime ray tracer and used prefetching when traversing KD-tree* i know not what a KD-Tree is, but i presume it uses ptrs to store data, so data will not be linear in memory, therefore prefetch would make sense, and achieve some speed up. dont bother with that article, i'll do some more research... ___________________________ |
HoHo
Member #4,534
April 2004
![]() |
Quote: i presume it uses ptrs to store data, so data will not be linear in memory You persume wrong. The KDTree is static and calculated in preprocesing step and gets stored in single array. That makes things a bit better than linked list. The data structure is laid out so that close nodes should be quite close in memory too so when one node is prefetched some of it's neibourghs get prefetched too. Each node is 8 bytes so usually quite a lot of them get fetched. __________ |
dudaskank
Member #561
July 2000
![]() |
Hoho, that piece of code was on the filterMakeMonochromApprox2() on your post... so when you said it didn't work, I've made some test... the code:
well it's Java but you get the idea, hehehe... the output in my machine is: gray: 80 gray rgb1: 808080 gray rgb2: 808080 a simple benchmark... rgb1 method 100000000 times: 971 ms rgb2 method 100000000 times: 951 ms so you can see the method #2 works too... but don't have that super speed improvement that I think, hehehe Toque a balada do amor inabalável, eterna love song de nós dois |
A J
Member #3,025
December 2002
![]() |
that just makes the colour grey{Solid} we (as the topic heading indicates) are trying to do grey{scale} ___________________________ |
HoHo
Member #4,534
April 2004
![]() |
Also there is no memory access. For a bit better performance numbers you should put that whole function content to a new function an call it around five to ten times in a row. I wouldn't be suprised if speed increases several times. __________ |
|
|