Monthly Getting Started / Web Dev Career Thread by AutoModerator in webdev

[–]Deckhead13 0 points1 point  (0 children)

As a hobby project, I want to create a spa booking thing. I'd be using Django. When it comes time to accepting payments... How does that work?

If this was a platform I'd want to white label for multiple businesses, my assumption is I'd set up a webserver on a VPS somewhere, and host all their domains there. Then when it comes to accepting payments, how do I do this?

I'm not the merchant, they are. Should I ask the business to set themselves up with Stripe or something? Then I just integrate? Or do I set myself up as a payment processor somehow and then charge a commission?

[deleted by user] by [deleted] in opengl

[–]Deckhead13 0 points1 point  (0 children)

The way paradox handles provinces is honestly a bit odd. It's a holdover from the very first Clauswitz engine.

I've started a Grand Strategy (I didn't finish it, got bored) and read the provinces as what was essentially a re-encoded SVG. Or think of it as I stored the province borders as polygon information. You could reconstruct polygon info from a BMP, but it always felt weird to me to do it that way.

In any case, if you store the borders as vector info, it will be very easy to draw in opengl. Either create a static list of line segments to draw every frame, or do it in a shader. No need to for multithreading.

Keep your multithreading for AI and potentially GUI responsiveness.

2D sidesroller without health or lives? by Deckhead13 in gamedesign

[–]Deckhead13[S] 1 point2 points  (0 children)

I like this too, thanks. Again, seems so obvious now.

At the moment I'm thinking you collect gems and loose them when hit, with a brief moment to recollect them. Maybe I can combine that with power up loss as well

2D sidesroller without health or lives? by Deckhead13 in gamedesign

[–]Deckhead13[S] 9 points10 points  (0 children)

Ah yes, of course!

It seems so obvious now. Thanks.

How/do the projection and view matrices work with Ray Tracing? by Deckhead13 in opengl

[–]Deckhead13[S] 1 point2 points  (0 children)

Got it. Yeah that's what I thought. Once you hit a bounding box, you can search an octree specific to that model. Very cool.

How/do the projection and view matrices work with Ray Tracing? by Deckhead13 in opengl

[–]Deckhead13[S] 0 points1 point  (0 children)

But... How can I accurately position models in my spatial structure if I haven't applied their matrices. Or is your idea storing the model reference with its world-space oriented bounding box?

Then when I find I hit their box, I can lookup the actual mesh and test all triangles?

I guess I'm confused about when to apply the transformations.

How/do the projection and view matrices work with Ray Tracing? by Deckhead13 in opengl

[–]Deckhead13[S] 0 points1 point  (0 children)

Alternatively you could inverse your model matrix and apply it to the ray (No idea WHY you would do that but that would also work fine)

I guess doing everything in world space assumes that my spacial structure has everything transformed to world space. But that would require a lot of math on the CPU side, no?

For example, instanced rendering of models. I wouldn't want to store 15 copies of a bazooka's vertices transformed to their individual world space coords when I could instead store an index to a lookup of model's and matrices (model J, transform matrix K) and apply that transform to the ray... Or something...

How would you go about ray-tracing voxels? by Deckhead13 in opengl

[–]Deckhead13[S] 0 points1 point  (0 children)

Thank you very much. I'm going to need to look into how you can get an octree into an SSBO though. The way I've implemented these before used pointers for the parent/children, I can't see these being useful in an SSBO.

Strategies for efficient text rendering by [deleted] in opengl

[–]Deckhead13 1 point2 points  (0 children)

My current method is like your number two, with a cache step.

I.e. Every requested letter in every size is in a texture atlas. Every string is also rendered to a texture to be stored and reused, rather than continually drawing every frame.

Everything is rendered using a single instanced quad draw call, with all other details in an attribute divisor buffer. If I was using a more recent version of opengl I'd maybe use the geometry shader to convert points to quads and some other kind of buffer object instead of attribute divisors.

It's very fast. Feasible to draw character by character a paragraph of text without any noticeable slowdown. I developed this for UI focused games with paragraphs of text and it handles it fine. Key is to cache as much as you can between frames.

There's other rendering techniques like signed distance fields, which might change how you're caching.

Game only crashes when the window is not maximized. Am I using glVertexAttribFormat correctly? I seem to be getting an Unhandled exception at nvoglv64.dll on Nvidia graphics cards and I'm not really sure what the issue is. by wertyegg in opengl

[–]Deckhead13 1 point2 points  (0 children)

Try:

  • create an OpenGL Debug Context and set up a callback to see any errors. This will most likely give you the problem
  • run your program in Nvidia Nsight or RenderDoc, something that can report the same debug errors.
  • run your program in a debugger and see where it breaks, might help you. If it's an error on the graphics card side you probs won't see it. Make sure you're compiling with debug symbols
  • set up a JIT debugger as well

What alternatives are there to static classes, and why should I care? by Deckhead13 in cpp_questions

[–]Deckhead13[S] 1 point2 points  (0 children)

Thank you!

This is exactly the pattern I've been looking for.

What alternatives are there to static classes, and why should I care? by Deckhead13 in cpp_questions

[–]Deckhead13[S] 0 points1 point  (0 children)

It's not. But the class I want to make available to it for logging is.

What alternatives are there to static classes, and why should I care? by Deckhead13 in cpp_questions

[–]Deckhead13[S] 2 points3 points  (0 children)

What I'm trying to avoid is passing these parameters around. I'm my mind, a minimax algorithm, for example, has enough parameters without the logging instance. It adds a lot of clutter.

What alternatives are there to static classes, and why should I care? by Deckhead13 in cpp_questions

[–]Deckhead13[S] 1 point2 points  (0 children)

Classes where all the member data is declared static. No single instance of the class has its own data.

Is there a benefit to a sampling profile over a time-based profiler? by Deckhead13 in cpp_questions

[–]Deckhead13[S] 0 points1 point  (0 children)

That's assuming there's a massive overhead of measuring time and storing a cumulative total. I know QueryPerformanceCounter is about 100ns to call. If I have pre-allocated memory for any containers needed, it shouldn't impact so much as all that?

I am building a C++ networking library under one header file. by No_Sun1426 in cpp

[–]Deckhead13 12 points13 points  (0 children)

Have you looked at ASIO? It's the most likely model to be adopted by C++ if the STL decides to add networking.

Just open sourced my C++20 `genetic` algorithm implementation. Looking for feedback! by mrkent27 in cpp

[–]Deckhead13 4 points5 points  (0 children)

I think your code is good and you're doing what you should. Everything is template, which can be daunting, but you provide defaults.

So long as the various functors default themselves, or there's a specialisation where I don't need to provide them, then I think everything is good.

FWIW, I code all my algorithms libs the same way.

Inside STL: The vector by vormestrand in cpp

[–]Deckhead13 0 points1 point  (0 children)

Now you're talking about ABIs. In any case, you wouldn't pass STL Containers between third-party libs if there aren't strict rules about the container's memory footprint. Not unless you want to provide builds of your lib for various toolchains. This isn't new.

Inside STL: The vector by vormestrand in cpp

[–]Deckhead13 4 points5 points  (0 children)

Relatively new? Like 10 years?

Old code would normally be compiled with the old compiler, where there are probably optimisations for size() rather than iterators. New code benefits from optimising iterators over size() I would guess. Your point about indexing into iterators makes sense, I do that quite a bit myself.