[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

XNA 4.0 HLSL Drawing a Triangle

Posted on 2011-09-10
2
Medium Priority
?
604 Views
Last Modified: 2012-05-12
I came across an article that didn't go into much depth.  Is it possible for an Effect file to automatically draw a triangle, if I feed it a Vector3 location?

0
Comment
Question by:Iamtehbest
  • 2
2 Comments
 
LVL 12

Expert Comment

by:satsumo
ID: 36523507
As far as I'm aware no current rendering architecture can create vertices in a shader.  To draw a triangle you need to give it three vertices.  The closest you coan get is using a point sprite with an image of triangle.

Strangely the PS2 could do this, and I suspect modern hardware works the same way.  It's the programming interfaces that get in the way.
0
 
LVL 12

Accepted Solution

by:
satsumo earned 2000 total points
ID: 36526797
Then again, maybe I was wrong.  This article describes a method of drawing multiple instances in Direct 3D, you may be able to use this method.  You still give it three vertices for a triangle, but the instance data could be a single point and the shader could change the output based on that point.

http://msdn.microsoft.com/en-us/library/bb173349(v=vs.85).aspx
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question