Drawing and Rendering with DirectX11

The Partridge Family were neither partridges nor a family. Discuss.
eXscreen
Posts: 4
Joined: August 23rd, 2014, 5:49 pm

Re: Drawing and Rendering with DirectX11

Post by eXscreen » September 1st, 2014, 10:03 pm

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.

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: Drawing and Rendering with DirectX11

Post by LuisR14 » September 1st, 2014, 10:07 pm

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 :mrgreen: --

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Drawing and Rendering with DirectX11

Post by chili » September 3rd, 2014, 3:54 am

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

User avatar
jkhippie
Posts: 218
Joined: March 24th, 2014, 5:11 pm

Re: Drawing and Rendering with DirectX11

Post by jkhippie » September 4th, 2014, 1:10 am

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. :roll:
To strive, to seek, to find, and not to yield.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Drawing and Rendering with DirectX11

Post by chili » September 4th, 2014, 3:57 am

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

User avatar
jkhippie
Posts: 218
Joined: March 24th, 2014, 5:11 pm

Re: Drawing and Rendering with DirectX11

Post by jkhippie » September 4th, 2014, 3:05 pm

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.

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: Drawing and Rendering with DirectX11

Post by LuisR14 » September 4th, 2014, 6:04 pm

jkhippie wrote:Wouldn't a triangle fan 'circle' either be not-quite-round or need a large amount of tris to actually be round?
yea that would be the case :)
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 :mrgreen: --

User avatar
jkhippie
Posts: 218
Joined: March 24th, 2014, 5:11 pm

Re: Drawing and Rendering with DirectX11

Post by jkhippie » September 5th, 2014, 11:50 pm

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. :lol:
To strive, to seek, to find, and not to yield.

PutPixel255
Posts: 363
Joined: March 12th, 2013, 6:06 am
Location: "Keep Louisville Weird"

Re: Drawing and Rendering with DirectX11

Post by PutPixel255 » September 6th, 2014, 8:28 am

Chilli wrote:I'm glad to see you've come around and left PutPixel behind.
What what what's this.
For the next video I vote that Chili teaches us to bunnyhop.

Post Reply