Drawing and Rendering with DirectX11
Re: Drawing and Rendering with DirectX11
I managed to port the platformer to DX11 using spritebatch and have abandoned the PutPixel thing.
But now i have a different problem. Because the game is running at a greater FPS its also updating
more times and is causing the dude to run, jump and change bitmaps insanely fast. I tried limiting the FPS to 60 but it didn't work. I'm thinking of only updating it in certain intervals using the timer class.
But now i have a different problem. Because the game is running at a greater FPS its also updating
more times and is causing the dude to run, jump and change bitmaps insanely fast. I tried limiting the FPS to 60 but it didn't work. I'm thinking of only updating it in certain intervals using the timer class.
Re: Drawing and Rendering with DirectX11
yes, that what should really be done for animations, to update them at time intervals instead of frame intervals (of course you could also increase the frame interval count to compensate from such problem, but i just believe time interval is better imo)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Re: Drawing and Rendering with DirectX11
I'm glad to see you've come around and left PutPixel behind. When you need to manipulate individual pixels (for special effects etc.), don't try accessing the texture/framebuffer memory directly; write a pixel / vertex / geometry shader to accomplish what you need.
Chili
Re: Drawing and Rendering with DirectX11
Is a pixel shader the way to go for doing things like DrawLine or DrawCircle? Or should I dig into the D2D1 shit for its geometry nonsense? I've looked at that, but I was turned off by all the different method involved. I guess one gets used to it, but I'm lazy as shit.
To strive, to seek, to find, and not to yield.
Re: Drawing and Rendering with DirectX11
Well, lines without width are one of the basic primitives, so you don't need to do anything special for them. For lines with width, use quads. Circles can be done with a triangle fan, and that's probably the fastest way. You can use a geometry shader to do tesselation if you need to be able to zoom in. Pixel shader can give you a pixel-perfect triangle, but it will be a lot slower.
Chili
Re: Drawing and Rendering with DirectX11
Wouldn't a triangle fan 'circle' either be not-quite-round or need a large amount of tris to actually be round? I guess I'll have to try it.
To strive, to seek, to find, and not to yield.
Re: Drawing and Rendering with DirectX11
yea that would be the casejkhippie wrote:Wouldn't a triangle fan 'circle' either be not-quite-round or need a large amount of tris to actually be round?
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Re: Drawing and Rendering with DirectX11
I think I need to put this shit on hold and get back to the vids. I'm missing the soft, soothing sounds of Chili's voice - the 'Barry White' of programming.
To strive, to seek, to find, and not to yield.
-
- Posts: 363
- Joined: March 12th, 2013, 6:06 am
- Location: "Keep Louisville Weird"
Re: Drawing and Rendering with DirectX11
What what what's this.Chilli wrote:I'm glad to see you've come around and left PutPixel behind.
For the next video I vote that Chili teaches us to bunnyhop.