Page 2 of 2

Re: Drawing and Rendering with DirectX11

Posted: September 1st, 2014, 10:03 pm
by eXscreen
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.

Re: Drawing and Rendering with DirectX11

Posted: September 1st, 2014, 10:07 pm
by LuisR14
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)

Re: Drawing and Rendering with DirectX11

Posted: September 3rd, 2014, 3:54 am
by chili
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.

Re: Drawing and Rendering with DirectX11

Posted: September 4th, 2014, 1:10 am
by jkhippie
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:

Re: Drawing and Rendering with DirectX11

Posted: September 4th, 2014, 3:57 am
by chili
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.

Re: Drawing and Rendering with DirectX11

Posted: September 4th, 2014, 3:05 pm
by jkhippie
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.

Re: Drawing and Rendering with DirectX11

Posted: September 4th, 2014, 6:04 pm
by LuisR14
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 :)

Re: Drawing and Rendering with DirectX11

Posted: September 5th, 2014, 11:50 pm
by jkhippie
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:

Re: Drawing and Rendering with DirectX11

Posted: September 6th, 2014, 8:28 am
by PutPixel255
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.