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 8377099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:34:45+00:00 2026-06-09T15:34:45+00:00

In OpenGL we can set line pattern using glEnable (GL_LINE_STIPPLE);glLineStipple(2,0x00FF); And in dx9, we

  • 0

In OpenGL we can set line pattern usingglEnable (GL_LINE_STIPPLE);glLineStipple(2,0x00FF);
And in dx9, we can draw stipple line using ID3DXLine‘s method SetPattern(0x00FF).

But it seems that there is not such a method in dx11 to set pattern for stipple line. If it is true i wonder if there is a smart way to draw stipple line in dx11?

  • 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-09T15:34:46+00:00Added an answer on June 9, 2026 at 3:34 pm

    You might look at this question. It asks how to do line stipple in non-deprecated modern OpenGL, which is similar in functionality to Direct3D 10+.

    My answer basically was to use a combination of alpha testing and the geometry shader to do it:

    Perhaps you could also use a 1D texture with the alpha (or red)
    channel encoding the pattern as 0.0 (no line) or 1.0 (line) and then
    have the line’s texture coordinate go from 0 to 1 and in the fragment
    shader you make a simple alpha test, discarding fragments with alpha
    below some threshold. You can facilitate the geometry shader to
    generate your line’s texCoords, as otherwise you need different vertices
    for every line. This way you can also make the texCoord dependent on
    the screen space length of the line.

    The whole thing get’s more difficult if you draw triangles (using
    polygon mode GL_LINE). Then you have to do the triangle-line
    transformation yourself in the geometry shader, putting in triangles
    and putting out lines (that could also be a reason for deprecating
    polygon mode in the future, if it hasn’t already).

    Although this question was about OpenGL, the basic principles are exactly the same, you just have to map the shaders from the answer to HLSL, which shouldn’t be too difficult given their simplicity.

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

Sidebar

Related Questions

Apple example of freehand drawing GLPaint , painting using OpenGL ES can't draw with
I want to draw my opengl es animation in a customed UIView, how can
I want to set up multiple stencils in OpenGL and then draw into multiple
I'm currently trying to draw a quadratic surface with openGL.When using a single window,my
In OpenGL ES 2 you can set an array of strings as the shader
I'm trying to set up an OpenGL project using GLFW in Visual c++ 2008
I want to use shading on my OpenGL objects but can't seem to access
I've been reading that M3G is something based on OpenGL ES...so can I work
How can I render mathematical notations / expressions in Python with OpenGL? I'm actually
Can you blend Java and native OpenGL calls. For instance having the setup happen

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.