Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9247453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:43:54+00:00 2026-06-18T09:43:54+00:00

I searched some tutorials to learn HLSL and every tutorials I found talked about

  • 0

I searched some tutorials to learn HLSL and every tutorials I found talked about VertexShader and PixelShader. (the tutorials used a 3D game as example).

So I don’t know if vertexShader is usefull for 2D games.
As I know, a 2D game doesn’t have any vertex right ?

I have to use shader as post-processing.
My question is : Could you tell me if I have to learn VertexShader for my 2D game ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:43:55+00:00Added an answer on June 18, 2026 at 9:43 am

    2D graphics in XNA (and Direct3D, OpenGL, etc) are achieved by rendering what is essentially a 3D scene with an orthographic projection that basically disregards the depth of the vertices that it projects (things don’t get smaller as they get further away). You could create your own orthographic projection matrix with Matrix.CreateOrthographic.

    While you could render arbitrary 3D geometry this way, sprite rendering – like SpriteBatch – simply draws camera-facing “quads” (a square or rectangle made up of 2 triangles formed by 4 vertices). These quads have 3D coordinates – the orthographic projection simply ignores the Z axis.

    A vertex shader basically runs on the GPU and manipulates the vertices you pass in, before the triangles that they form are rasterised. You certainly can use a vertex shader on these vertices that are used for 2D rendering.

    For all modern hardware, vertex transformations – including the above-mentioned orthographic projection transformation – are usually done in the vertex shader. This is basically boilerplate, and it’s unusual to use complicated vertex shaders in a 2D game. But it’s not unheard of – for example my own game Dark uses a vertex shader to do 2D shadow projection.

    But, if you are using SpriteBatch, and all you want is a pixel shader, then you can just omit the VertexShader from your .fx file – your pixel shader will still work. (To use it, load it as an Effect and pass it to this overload of SpriteBatch.Begin).

    If you don’t replace it, SpriteBatch will use its default vertex shader. You can view the source for it here. It does a single matrix transformation (the passed matrix being an orthographic projection matrix, multiplied by an optional matrix passed to Begin).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've searched and I found some things about compiling to JARs in Eclipse, but
I searched around and found some tutorials explaining out to fix the problem, unfortunately
I have searched around and found some tutorials for xsl:key and key() function, but
Searched around on SO for an answer. Found some interesting stuff but I am
I've searched for an answer and found some c#-examples, but could not get this
I've searched the Internet and have found some good solutions for teeing STDOUT to
I searched through here as best I could and though I found some relevant
i searched google and this side and did some tutorials, i guess it is
I'm trying to create an webapp and searched around to find tutorials... I found
I'm new to SWI-Prolog and am trying some tutorials. Every file I try to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.