Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!

Erik Rufelt

Member Since 17 Apr 2002
Online Last Active Today, 04:49 PM

#5101152 "built-in loop" question

Posted by Erik Rufelt on 13 October 2013 - 07:36 PM

I'm just asking what causes that to happen, when I know that a screen ultimately consists of x*y pixels that keep updating as long as the PC screen is turned on. And if the program terminates, then what keeps updating the pixels on the screen? It sure ain't a terminated program.


Not that it matters here but in actuality I wouldn't say that's true at all.

The monitor keeps the light on in its pixel crystals constantly, and updates their colors in frequent intervals of for example 60 times per second.

The monitor chooses the colors to update to from a signal that comes from the computer through the cable.

The signal is generated from the values of some memory in the graphics card.

If a color value is written to that memory it stays there until over-written or the power is turned off, so on the software side it's more that a pixel stays the same on the screen until it is actively changed in memory by a running program.

Then in actual actuality it's probably somewhat different again and depends on many things but I don't even know.

#5100770 stretched software renderer

Posted by Erik Rufelt on 12 October 2013 - 05:14 AM

Same way. CreateTexture2D with dynamic usage and then ID3D11DeviceContext::Map / Unmap to lock and update it.

#5100628 Math roadmap: Calculus and beyond

Posted by Erik Rufelt on 11 October 2013 - 02:31 PM

Finish learning calc and differential equations first.

Searching for what to do next before finishing the first step is an excellent way to never get there.



Once you know everything there it will be much easier to search out information and see for yourself what different directions there are and what interests you the most.

#5100383 Direct2D/Direct3D (10) - How do I plot a single pixel on a texture2D?

Posted by Erik Rufelt on 10 October 2013 - 07:16 PM

My goal is to have a simple, fast 2D environment in which to set individual pixels as part of a series of basic exercise I'm working through.


What's the point of this?

If the exercise in itself is about implementing things by setting individual pixels then it's probably better to skip DirectX and use something that is made for that type of drawing.

#5099732 Few questions about DXGI formats

Posted by Erik Rufelt on 08 October 2013 - 04:50 PM

XR is extended range, to support a wider area of colors by sacrificing some precision. This page has a comparison table: http://www.techarp.com/showarticle.aspx?artno=645&pgno=6

#5097713 Get Display name(s) via DirectX 11

Posted by Erik Rufelt on 29 September 2013 - 08:11 PM

What kind of name do you wish to obtain?

You can often retrieve the model manufacturer/name of a display, though at other times it is only referred to as "Generic PnPMonitor" or something like that.

If you check the Device Manager in Windows the name under Monitors there can probably be retrieved.


GetPhysicalMonitorsFromHMONITOR and the szPhysicalMonitorDescription returned should contain this name.

#5096919 AMD's Mantle API

Posted by Erik Rufelt on 26 September 2013 - 04:25 AM

Sounds cool, wonder what exactly they mean by "direct access to graphics RAM".

#5096277 Nullptr over-defined all the sudden (wtf?)

Posted by Erik Rufelt on 23 September 2013 - 03:41 PM

It says parameter 4 but it seems there aren't 4 parameters in the function call?

Perhaps the error is something completely different. Try rebuild all or checking out the code anew into a different directory and building that, perhaps there's something cached from an old version.

#5095997 Triple Buffering can solve the sync problem?

Posted by Erik Rufelt on 22 September 2013 - 01:52 PM

The image-tearing should be fixed by VSync.

If audio-problems appear by v-syncing you probably buffer too little sound per frame, so that 60 FPS (or what your vsync interval is) is too long to keep up with the sound playing. Buffer more data each frame if that is the case.

#5094332 Beginning DirectX11 triangle demo will not run at all!

Posted by Erik Rufelt on 15 September 2013 - 05:31 PM

I don't know what code that is so there's certainly a point in posting it, preferably the shortest one that fails.

The solution is likely in improving the error handling to output a useful error message.


First of all, update your graphics card drivers to the latest version, and then post your GPU and your Windows version here together with the code.


If you're not using the D3D11_CREATE_DEVICE_DEBUG flag when attempting to create the device, use it and see if you get any additional D3D error output in your output window. If you are already using it, try removing it in case you're on Windows 7 with the latest update and using the old DirextX SDK instead of the Windows 8 SDK.


The error messages you posted contain messages about WARP and reference-devices which you probably don't want to be using if your system supports D3D11. It could also be a driver problem.


...as it's happening on all of the different non compiled solutions.


Does that mean that you can download already compiled binaries of the same code that works correctly?

That would increase the likelihood that the problem is with the SDK version or similar.

#5094096 Simplifying Static Mesh Geometry and Topology

Posted by Erik Rufelt on 14 September 2013 - 04:35 PM

That usually isn't a good idea, as you introduce T-junctions in your model. Each edge should only border exactly one other edge, and no vertices. When drawing the model the two lines won't always line up perfectly with interpolation and floating point inaccuracies so you can get artifacts at the edge.

#5094018 Beginning DirectX11 triangle demo will not run at all!

Posted by Erik Rufelt on 14 September 2013 - 10:31 AM

S_OK means success... post your code, perhaps you just have a mistake in how you handle the result.

#5092525 Other name for "Space Police"

Posted by Erik Rufelt on 08 September 2013 - 01:23 PM

Imperial Enforcement Agency

#5091011 glGetUniformLocation not working

Posted by Erik Rufelt on 02 September 2013 - 05:59 AM

In your shader, using your own uniform is correct, don't use gl_*. Use #version 400 core and they should give compiler errors as they're removed from the language.


Anyway your problem seems to be this:

 glDetachShader(programId, vertexShaderId);
 glDetachShader(programId, fragmentShaderId);

Remove that code.

#5090856 Single vs Multiple Constant Buffers

Posted by Erik Rufelt on 01 September 2013 - 02:16 PM

Tried it right now, and got zero difference between them, even with abnormally large buffers, though in certain cases with one very large buffer and one very small and already a high usage of bandwidth to video memory for other things there can certainly be a difference...


Consider a case where a complex shader indexes into a constant buffer of a couple of thousand vectors that doesn't change between objects, and there's 1000 objects where the only change is the translation matrix, then uploading 64 bytes per object is much better than 32,000 bytes, especially if each frame there is also a couple of different transfers of reasonably large dynamic textures going on.