Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

A great use of texturing engines

Name: Anonymous 2009-08-28 7:25

Anyone doing 2d graphics using OpenGL or Direct3d?

Did you realize you can render a quad using a single triangle if you leave enough transparent space in your texture?

Your mind is now blown!

Name: Anonymous 2009-08-28 7:52

This is amongst the most retarded things I've heard in my life. Not only it's obvious, but also it just fucks performance all over.

If anything, it's deeply beneficial to trim stuff as tightly as possible:

http://humus.name/index.php?page=News&ID=266

Obviously, for a rectangle, the best trim is... a quad.

Name: Anonymous 2009-08-29 0:46

>>2
Triangle strip, please. Quads are legacy and poorly defined.

Name: Anonymous 2009-08-29 5:10

>>3

Triangle stips are legacy, too. It's all indexed geometry nowadays.

Name: Anonymous 2009-08-29 5:17

>>3
Nvidia GPUs use quads internally.

Name: Anonymous 2009-08-29 5:23

>>5

Utter bullshit.

Name: Anonymous 2009-08-29 6:08

>>6
a couple of weeks ago on of the lead guys at nvidia mentioned there hardware does quads i.e. it doesnt change them to 2 triangles.
http://www.gamedev.net/community/forums/topic.asp?topic_id=538545

Name: Anonymous 2009-08-29 6:41

>>7
where hardware?

Name: Anonymous 2009-08-29 6:44

>>7

Quoting a quote is useless. /r/ing sauce on internal quad usage!

Name: Anonymous 2009-08-29 7:20

Maybe on Linux without proprietary drivers OP's idea works, since the open source drivers are so bad that processing a single triangle on the CPU is slower than a screenful of alpha-blending on the GPU.

Name: Anonymous 2009-08-29 8:34

ITT: why game programmers are almost as much of a joke as web developers.

Name: Anonymous 2009-08-29 9:13

>>11
Butthurt enterprise developer who would never manage to write a game which used less than 32GB of RAM and ran at more than 5fps.

Game programming is one of the few things that still amazes me. The other day I was playing a game that gets 95% speedup out of a dual core processor, the fucker ran at 100fps drawing about 300000 tris/frame, with half a dozen ragdolls running and about a hundred rigid body physics objects flying by. Doing that in less than 10 milliseconds really is something. What can your enterprise bullshite do in 10ms? Change the fucking mouse cursor into an hourglass?

I'll give you that a lot of games are coded like shit though, but I have a feeling the ratio is generally lower than for normal commodity software or web stuff, and much much much lower than vertical market enterprise trash.

Name: Anonymous 2009-08-29 9:15

>>7
I looked a bit into D3D and the Windows Driver Model, and it doesn't support quads. It supports points, lines, line strips, triangles and triangle strips.

OpenGL does support quads and since the GPU guys implement both the user-mode ICD and the kernel mode crap, it's very possible they're implemented in hardware. I guess some shitty CAD program needs them to be fast. Also some old games, I recall Half-Life and Counter-Strike wallhacks using rendering primitive types to detect whether the game was drawing the world (GL_QUAD_STRIP or GL_POLYGON), flashbangs, smoke or the sky (GL_QUAD), or models (GL_TRIANGLE_STRIP or GL_TRIANGLE_FAN).

However IIRC they're going to get the axe in 3.x

In any case the rasterizer needs modernizations. Triangles are a very rudimentary solution to the problem, and when their average size starts approaching that of a single pixel, it's time to think deep and hard about it.

Name: Anonymous 2009-08-29 10:11

>>12
What can your enterprise bullshite do in 10ms?

Handle more money than you can ever hope to earn in your lifetime.

Name: Anonymous 2009-08-29 10:20

>>14
My $3 solar cell powered calculator can also do that (on very sunny days).

Name: Anonymous 2009-08-29 10:55

>>11
WHAT ARE YOUR CFLAGS, FRAULEIN? !!

Name: Anonymous 2009-08-29 11:58

I was once a game programmer. then I got promoted to flipping burgers.

Name: Anonymous 2009-08-29 12:21

>>1

Did you realize you can render a quad using a single triangle if you leave enough transparent space in your texture?

no you can't, I will explain why:

there's 6 parameters for the triangle with texture, but you need 8 parameters for an arbitrary quad.

Name: Anonymous 2009-08-29 12:30

>>18

You can make the triangle so big that it encloses the quad.

Name: Anonymous 2009-08-29 17:39

>>19
Maybe he means a quad where the fourth vertex isn't in the same plane as the other three.

Name: Anonymous 2009-08-29 18:19

>>20
Not a quad, then. That's two triangles.

Name: Anonymous 2009-08-29 18:27

>>21
Will you realize your can render a quad that using two triangles if leave enough space in from texture?

Name: Anonymous 2009-08-29 18:43

>>19-22
Attributes. Attributes. Attributes. A quad has four vertexes with VERTEX ATTRIBUTES that can be interpolated across the drawn fragments.

Name: Haxus the OpenGL Dev 2009-08-30 0:13

Haxus the OpenGL Dev

Name: Anonymous 2009-08-30 0:35

>>21
mind = blown

Name: Anonymous 2009-08-30 0:41

>>23
Unscientific and ultimately delicious

Name: Anonymous 2009-08-30 1:31

>>23
interpolated across the drawn fragments
That sounds painful.

Name: Anonymous 2009-08-30 8:19

>>23
Hmm... You're right. Now I remember why you can't approximate a lightmap with tessellation and vertex lightning: the interpolation it's going to look very fucked up. It is very visible with certain stuff too (specularity comes to mind).

So how does that work in quads? That would really need hardware support, or a ninja driver that puts the attributes in a 2x2 texture for sampling, which I would consider  harmful performance-wise.

In any case, FUCK TRIANGLES. I want NURBS. The real deal, not some shitty hardware-tessellation crap.

Name: Anonymous 2009-08-30 10:05

>>23

That's true, however OP said "render a quad using a single triangle". Not "render any quad". ;)

Name: Anonymous 2009-08-30 10:22

Triangle man, triangle man
Triangle man hates particle man
They have a fight, triangle wins
Triangle man

Name: TMBG MEME FAN 2009-08-30 13:26

>>30
There is a legend that every day, there is a stimulus on /prog/ and a new MEME FAN is born.

Name: Anonymous 2009-08-30 13:38

>>30
SHUT. UP.

Name: Anonymous 2009-08-30 15:24

>>30
hipster alert: hipster fag detected in sector Z !!

Name: Anonymous 2009-08-30 21:05

go on, just waste a shitton of fill rate for one less vertex and at best 3 less indices (which would mean your original implementation was braindead to begin with and you should just kill yourself)

Name: Anonymous 2011-02-04 14:30

Name: Anonymous 2011-02-04 15:32

Don't change these.
Name: Email:
Entire Thread Thread List