Jump to content

  • Log In with Google      Sign In   
  • Create Account


mrbastard

Member Since 09 Oct 2000
Offline Last Active Jul 13 2014 03:35 PM

#4959733 Specifying library version requirements in windows

Posted by mrbastard on 16 July 2012 - 02:42 PM

(assuming c/c++)

It seems odd not to mention windows/system32 (as an oft-abused dumping ground for dlls) or WinSxS

Working out which particular dll file windows will try to use at runtime on a given machine has been something of a black art for the last few years - WinSxS was supposed to fix 'dll hell'by allowing you to specify a version number and hash to ensure you get the file you want, but it's rather awkward, so nobody except microsoft wanted to use it.

Apparently the latest solution used for the platform runtimes is to have a version number in the file name, tada.

COM has a whole version/dependency system unto itself, and I suspect WinRT has something similar but new too. I may be wrong.

But really this is all unlikely to help, sorry OP! WinSxS will do what you want, but I suggest you avoid it. Common practice on windows is to package every dll you depend on with your app's installer and dump all the dlls into the app's folder. (then test will something like ProcessMonitor, to make sure WinSxS or similar isn't doing something unexpected). If an installer or (better) merge modules are available for some of the libs you depend on, great.

Not sure how much sense that makes, but gives you some more googleable terms to work with Posted Image


#4959299 Build problem with VS 11

Posted by mrbastard on 15 July 2012 - 10:56 AM

And here is a bit more information on the choice of crt, in case you're still lost.


#4947442 Singleton pattern abuse

Posted by mrbastard on 08 June 2012 - 12:27 PM

With respect, you haven't given an example of a singleton you can't see how you could replace - you've given an example of a singleton you can see a couple of ways to replace. You just don't like them! Posted Image

How can I access my texture manager in the object's load function if it's not a singleton? Pass it as an argument? Keep a pointer to it as a member of the class? None seem very efficient to me. Even if passing it as a reference isn't slowing performance, it makes functions more complicated than they need to be, since the texture manager reference would have to be passed down many functions to reach the load function.

Don't worry about performance here: if your resource loader ever sees any heavy duty use you're going to want to it to be thread-safe, and it'll be more work to lock your singleton instance for every possible eventuality than it is to pass around a few references.

Likewise, you may have the wrong instinct on complexity here - it's much much easier to reason about chains of functions passing references than devil-may-care global accesses everywhere. You've probably already seen some of this while removing the other singletons you talked about, but (at least in my experience) it only gets worse as your codebase gets bigger. Complexity in terms of typing/reading is just par for the course - complexity in understanding side effects is what you should really be aiming to reduce.

It's hard to give practical advice without seeing your code - maybe be more specific about where your loader func is used, where else uses the texture manager, and what you envisage should own the texture manager.


#4940623 What's the point of private class members and methods(C++)

Posted by mrbastard on 16 May 2012 - 02:23 AM

Private state encapsulates class invariants.


And as we know, enforcing invariants is the only valid reason to create a class. (to paraphrase Stroustrup)

Rather than asking "what are private members for?", better to ask "what are public members for?" and "why am I creating these class things anyway?"


#4889908 handling UV discontinuities

Posted by mrbastard on 02 December 2011 - 02:47 PM

Who'd have thought there'd be so many graphics programmer Tool fans!


What do you think about contributing a sample application to Hieroglyph 3 that implements this algorithm? If you don't have time to translate from your code to the Hieroglyph basis, then I could volunteer to do the conversion for you. It seems like a cool enough application that it should live on somewhere :) And of course you will be credited with your work.

Great idea, I'd love to. I've been meaning to spend some time with Hieroglyph since I bought the book last month. Posted Image I'm guessing it'll be fairly easy to convert as it's pretty much all in the pixel shader. The only real exception to that is use of FMOD to play back the sound and do FFT to give me the current sound spectrum. The spectrum goes in an array in my constant struct and is used to distort the trapping shape, UVs and colours in time to the music. Not necessarily a big loss though, as I haven't yet found a way to use it that I'm satisfied with.

Anyway - I'm hoping to work on the texturing problem over the weekend, and probably finish up the demo over the next couple of weeks. Then I'll have a look at translating it to Hieroglyph.


#4889184 handling UV discontinuities

Posted by mrbastard on 30 November 2011 - 02:28 PM

I'm working on a demo which computes the mandelbrot set in an HLSL pixel shader. I've been getting some great effects by using an 'orbit trap' and using the resulting values as texture coordinates.

The problem is that where the texture coordinates change very quickly between pixels I get horrid artifacts. See the thin, broken purple lines in the image below.

Posted Image
Ignore the texture magnification blur in the middle bottom of the image - it's just a low res texture!

Here's an image of the UVs, ( u in red, v in green, blue=0 ) - hopefully that points out where the artifacts would occur, even if you can't immediately see them in the first image Posted Image
Posted Image


Now, some of you are probably already reaching for a link to docs on sampleGrad. I've tried playing with it, but so far have only managed to bias the problem one way or the other - one side or other of the round features is still 'bad'. I may not fully understand what I'm doing though, and I'd be very grateful for an explanation if anyone thinks this is the right route to go down.

Another possible solution which I'm working on is to render the UVs to a texture and smooth them out with a box filter. I'll lose detail in the UV map, but I don't think that will make much difference to the final image.

I've also tried just painting over the artefacts - as they occur at the very edge of the 'trapping circle' I guessed they would fall between ~0.99 and 1.0. It turns out that the artefacts are actually on pixels next to (but sufficiently different in UV value from) the pixels with values 0.9...1.0. This is what led me to believe I couldn't solve this with knowledge of only one pixel - I need to use ddx/ddy/sampleGrad or another pass.

Any suggestions?


#4880797 MSVC std::vector and aligned data

Posted by mrbastard on 05 November 2011 - 09:52 AM

As you can see by the first link, this wll be fixed in VC11.


I just had a quick check - this is in the version of <vector> in the vc11 developer preview.





#4872582 Strange issue with default deconstructors

Posted by mrbastard on 14 October 2011 - 10:58 AM

I love you, I never even knew this existed!


HTH. Yeah, it's one of those tricks that deserves to be much more well known, given the incredible amount of time it can save.

Posted Image

edit: I love the disclaimer on the bottom of the glflags page:
Note Incorrect use of this tool can degrade system performance or prevent Windows from starting, requiring you to reinstall Windows.

Wow. You'd think they'd reset the flags on restart Posted Image




#4872571 Strange issue with default deconstructors

Posted by mrbastard on 14 October 2011 - 10:40 AM

If you've spent more than a few hours on this, here's what I would do:

1) assume a bug elsewhere in your code is overwriting the pointer stored by the string, or other similar source of heap corruption

2) assume that if you were going to find the bug by examination, you would have already done so - you are looking at your diffs, right?

3) use gflags to temporarily enable 'full heap' option for your process so that you're more likely to get an actual access violation when your heap corruption occurs

Actually, read this document

4) remember to switch it off again

5) wonder why there isn't a button for this relatively common task in visual studio Posted Image


#4869860 Motion Blur (WebGL) Demo

Posted by mrbastard on 06 October 2011 - 12:46 PM

Cool stuff. I found the blog post really interesting, looking forward to more. Posted Image


#4856684 What does GDNet think about my game engine?

Posted by mrbastard on 02 September 2011 - 05:37 AM

Replying to both Apoch and Phantom here, as replying to individual points will get messy, fast. Sorry guys, I know you aren't the same person and have acted differently in this thread, but I think my main point here is that you're moderators, and I expect better, for which it's easier to lump you together.



Honestly, the problem is that you appeared to enjoy criticising. You clearly spent considerable time and effort on your criticism, and it seemed to me that you were motivated more by the enjoyment than the help you were giving. I think the sheer volume of criticism, some of it (but certainly not all, I agree) on topics where the OP had not solicited your advice, is what left a bad taste. If this guy is so undeserving of your attention, then I can only imagine that your motivation for continuing has to be either to put him down or to enjoy yourself. If his replies discourage you from helping, just stop replying. You're bigger than that. You don't have anything to prove by continuing to 'help'. Continuing to reply, but in a less friendly manner, doesn't really help anyone.

I think maybe the bits that came across as unnecessary to me were bits where you were actually trying to inject some humour to lighten the mood - well intentioned I'm sure, but when it's not clear whether you're laughing with or at somebody, it's wise to be careful.

I can be similar when writing code reviews - but I've learnt that it usually ends up with the advice being ignored because the person you're advising just doesn't trust you any more.


#4856352 What does GDNet think about my game engine?

Posted by mrbastard on 01 September 2011 - 10:12 AM

Huh? Where exactly did they start bullying anybody? Harsh criticism is hardly bullying or a personal attack. So, uhm?


I repeat that I do not think it was ever intended as such, by either of them. And I agree that harsh criticism has a place on a technical forum.

I think the sheer volume of criticism, and in places apparent (but possibly not actual) venom gave me the overall impression that they rather enjoyed themselves, at the OP's expense.

I'll restate my own criticism, as it too could be construed as a personal attack, which really isn't fair of me:

While harsh criticism is a fundamental way of teaching technical topics, and while both Phantom and Apoch are certainly able teachers and both made some important points, the overall tone seemed to me as a disinterested observer to be overly combative. While there's nothing wrong with that in itself, I would prefer moderators to moderate their own tone. I am aware that my preference doesn't mean much, but felt strongly enough to post.

Hopefully that's closer to a fair criticism.


#4856324 What does GDNet think about my game engine?

Posted by mrbastard on 01 September 2011 - 09:18 AM

So...... Did Phantom and ApocPiQ run out of IRL people to berate?

Because man.... a lot of that just came across as bullying to me. I'm sure it wasn't intended as such, but you guys are moderators and I expect more from you. You can be helpful and correct while also being friendly. Or if you can't.... maybe just don't post?

MODS, I AM DISAPPOINT.

Also: Hodgeman for mod. Consistently correct, informative and friendly. All at the same time!

(random opinions of a 10 year+ member)


#4853589 Bug in visual c++ 2010 with standard conforming code.

Posted by mrbastard on 25 August 2011 - 04:58 AM

So sue me for trying to help you get in touch with someone who could give you an authoritative answer Posted Image


Move away from the keyboard and go have some fun.


#4852194 Creating a distributeable program that uses direct X

Posted by mrbastard on 22 August 2011 - 03:20 AM


Now for the second part, Am I going to need to include like, the direct x 9 redistibuteable and the microsoft sdk redistributable or something in the folder i send the game to and just tell people to install those?

no just the DX redist.
it is located in the DX SDK folder.


And (almost certainly) the correct c runtime redist for compiler used. OP: look for "msvcrt"







PARTNERS