« first day (2866 days earlier)      last day (2157 days later) » 

11:31 AM
Can anyone help me with the architecture of SAP(Sweep And Prune / Sort and Sweep).
 
 
2 hours later…
1:22 PM
Does anyone know anything here about SAP(Sweep And Prune / Sort and Sweep).
 
@TheMaskedRebel You don't need to keep repeating yourself - your last message is still the newest thing folks will see when joining the chat.
 
@DMGregory thanks for the advice :)
 
user92578
Is there a neat way to modulate two colors that are represented as 32-bit integers? I of course could convert them to RGBA representations and modulate those, but can that be avoided somehow?
 
user92578
oh i can just probably multiply and add
 
user92578
1:38 PM
 
user92578
I'm experimenting with writing a software renderer that can render Dear ImGui with SDL's builtin renderer
 
What kind of modulation are you looking for?
 
user92578
Just a basic shading, so that white mod red becomes red
 
user92578
const uint32_t color = texture->Sample(u, v);
const uint32_t shade = vertexColor.Evaluate(x, y);

target.SetAt(x, y, color * 0.5 + shade * 0.5);
 
user92578
Seems to work fine
 
1:40 PM
Ah, like a multiply blend mode? Cool, I didn't realize that would work in 32 bits
 
user92578
hmm yeah tbh I'm not sure what exactly is wrong with my color code, is the the interpolation between vertices or texture sampling or the blending that is broken
 
user92578
hmm yeah no way that actually works
 
user92578
can't linearly interpolate those
 
user92578
2:44 PM
...still fighting with color stuff, can't get alpha blending to work properly
 
@Tyyppi_77 long time no see.
 
user92578
uuh yeah I guess? how's it going?
 
Well. You?
 
user92578
I'm doing good, just actually discovered a stupid stupid bug
 
user92578
R(((color >> 24) & 0xff) / 255.0f), G(((color >> 16) & 0xff) / 255.0f), B(((color >> 8) & 0xff) / 255.0f), A(((color >> 24) & 0xff) / 255.0f) { }
 
2:47 PM
And that is...
RGBA color calculator?
 
user92578
A is shifted by 24 where it should be shifted by 0
 
user92578
Yeah 32-bit integer to RGBA
 
Ah...
Logical errors
easiest to fix but the most devastating to the results.
 
user92578
yup
 
user92578
I'm really annoyed by this stuff, like I've been fighting with color values for a few hours now
 
user92578
2:51 PM
channels are still mixed up
 
Is that all the code?
 
user92578
no it's spread in a few places and I'm having really hard time figuring out what the issue is
 
user92578
texture pixel format can affect this
 
user92578
the int to rgba conversions can affect this
 
Can you give me example input?
For the variable color
 
2:57 PM
what is wrong @Tyyppi_77
 
user92578
 
user92578
the correct colors should be: red at topleft, green at topright and blue at bottom
 
what code do you use for that
 
@Tyyppi_77 ok... lemme think for 10 seconds
B(((color >> 24) & 0xff) / 255.0f), R(((color >> 16) & 0xff) / 255.0f), G(((color >> 8) & 0xff) / 255.0f), A(((color >> 0) & 0xff) / 255.0f) { }
that should do it
 
user92578
but that seems really odd
 
user92578
2:59 PM
wtf pixel format is BRGA?
 
@Tyyppi_77 just try it...
 
user92578
yeah that's the correct result, but the imgui rendering (the real issue) is still colored wrong
 
Image?
Oh...
@TheMaskedRebel Yes, I know.
 
user92578
Yeah that's just spam, not helpful at all
 
R(((color >> 16) & 0xff) / 255.0f), G(((color >> 8) & 0xff) / 255.0f), B(((color >> 24) & 0xff) / 255.0f), A(((color >> 0) & 0xff) / 255.0f) { }
Ah... I missed the commas
 
user92578
3:02 PM
correct color would be: 11, 22, 34 but I get 25, 19, 8
 
user92578
so now I'd assume that there's something wrong with the alpha channel that results in blending that messes up the rendering
 
@Tyyppi_77 no...
25 < 34
8 < 11
19 < 22
Thats the alpha doing its work
Can you give a screenshot of the result?
 
user92578
okay are you the fucking starrer @TheMaskedRebel?
 
user92578
 
user92578
correct at left, incorrect at right
 
3:06 PM
Guess I can't say that untill I know he's the starrer.
 
user92578
I've very unsure about where the issue lies
 
user92578
100% it is he, all the others in the chat are legit and this only happens when he's around
 
@Tyyppi_77 uh...
5 == 0b0101
5 >> 1 == 0b0010
When you shift over, you are mixing the colors.
@TheMaskedRebel Highly irrelevant and not helpful.
 
user92578
@TheMaskedRebel nice spam, flagged
 
@Tyyppi_77 You know that SE chat automatically inserts that image when someone types "this is fine", right?
 
user92578
3:11 PM
@ACuriousMind Yes as does he, since he's been doing that for a few days straight now since he learned about the feature.
 
wait it does
Hold on...
Huh.
 
I'm not going to do that at all.
@Tyyppi_77 Yes.... please don't use 1boxes
 
3:12 PM
Okay, but that's still neither spam nor offensive. Please only use span/offensive flags to draw attention to serious breaches of the Be Nice policy.
 
user92578
How is that not spam?
 
user92578
Are you kidding me?
 
@Tyyppi_77 The SE definition of "spam" is that it is the promotional kind, i.e. someone spamming links to a product or similar.
 
user92578
Well that's fucking ridiculous
 
@ACuriousMind Tis true, nonetheless his messages appear to have no context at all.
 
user92578
3:14 PM
So continuously disrupting conversations with large images is okay unless the image is an advertisement?
 
user92578
That's messed up.
 
@Tyyppi_77 I'm not saying that, I'm saying that that's not what the "spam/offensive" flag is for.
 
Oops wrong button
Use a mod flag
 
user92578
I also considered a special mod flag but it said had a scary tooltip.
 
user92578
I definitely count repeatedly posted off-topic images as spam.
 
3:16 PM
Alert a room owner or raise a custom moderator flag if you have concerns about content that's neither spam or offensive. There's a difference in how these flags are handled, the largest being that spam/offensive flags are shown without context to all 10k users across the network. So unless the message is really spam/offensive in isolation, that's not the right flag to use.
 
user92578
Blues always show up anyways so I didn't really think it was a big deal.
 
user92578
Anyways this proves once again how seriously fucking broken the chat moderation system is.
 
@Tyyppi_77 We can think that moderation is broken, but saying it to a mod doesn't help you in any way.
 
@Tyyppi_77 I'll agree that chat moderation is very suboptimal in some aspects, but I'd urge you to take a more constructive tone about it.
 
user92578
So just to clarify, the decision here is that the behaviour that was flagged (using a totally incorrect flag) is okay and totally fine?
 
user92578
3:20 PM
@ACuriousMind Also AFAIK room owner's cant suspend people, can they?
 
user92578
*owners
 
@Tyyppi_77 That's something for your room owners/the chat room to decide. Some chat rooms are fine with random messages and images, others are not. There's no overarching rule that would govern "frequently posting images".
@Tyyppi_77 No, but they can kick people and move messages, which is usually enough.
 
user92578
Man I've seen "be nice" bent in so fucking many different ways before but apparently this is not one of them then.
 
I think we should take this somewhere else?
Different room perhaps?
 
@FreezePhoenix I don't have anything more to add. Return to whatever your regular schedule is ;)
 
3:25 PM
Ok then...
 
user92578
Great.
 
Lets move these messages somehwere.
 
user92578
I'd actually rather not.
 
Ok then. Thats the mods choice kinda
 
user92578
Yeah I do realize that, just wanted to display my point of view on that too, not that it's worth anything.
 
user92578
3:27 PM
Censoring the conversation doesn't seem like the way to go to me.
 
@Tyyppi_77 5 cents worth, same as mine and same as @ACuriousMind 's
 
user92578
3:38 PM
 
user92578
flipped some shifts here and there
 
Well yes.
 
user92578
now I just need to figure out what's wrong with the text rendering
 
@Tyyppi_77 check you are not averaging your text objects
 
user92578
what does that even mean
 
user92578
3:48 PM
I don't have text objects
 
I'm not sure what that means either
Please explain in detail
 
@Tyyppi_77 How do you render the text
 
user92578
By sampling a texture at the texture coordinates that ImGui feeds me
 
user92578
I think that sampling is the issue
 
@Tyyppi_77 yeh thats the issue
 
3:50 PM
0
Q: Is it okay to repeatedly disrupt conversation in the chat room by posting images?

Tyyppi_77I was surprised to find out that it's not against the rules to repeatedly post images to the chat room to disrupt the ongoing conversation as long as the image is not an advertisement. I'm especially talking about messages like these: https://chat.stackexchange.com/transcript/message/45070687#4...

 
@Tyyppi_77 whistles that does not belong on GDSE meta
 
user92578
The mod that was here said that how these are handled are room based, and I don't know what your policy is, so I asked.
 
user92578
Our chat questions do belong on meta.
 
user92578
Color Sample(float u, float v) const
{
	const int x = static_cast<int>(floor(u * (Surface->w - 1)));
	const int y = static_cast<int>(floor(v * (Surface->h - 1)));

	return Color(static_cast<uint32_t*>(Surface->pixels)[x + y * Surface->w]);
}
 
user92578
Here's how I sample
 
3:53 PM
@Tyyppi_77 can I see your texture.
 
@Tyyppi_77 So it's opinionated :P So it belongs nowhere (JK)
 
user92578
I think he wants the texture I'm sampling
 
user92578
hold on
 
user92578
 
user92578
there, it's the 512x64 stuff at the top
 
3:56 PM
LOL
that one white square at the top?
change it to blue
If you can
 
user92578
I can't
 
user92578
But that's the pixel that ImGui uses for rendering the rectangles
 
user92578
All the background areas have their texture coordinates pointed at that pixel, and then it's shaded with a vertex color
 
user92578
and yes I do get non-zero coordinates if that was your point?
 
@Tyyppi_77 Can I see how it is shaded. It looks like the pixels have been averaged out.
 
user92578
4:00 PM
So I was able to fix something and now they are no longer boxes:
 
user92578
 
user92578
const Color old = Color(Pixels[location]);
const Color dest = Color(
	src.R * src.A + old.R * factor,
	src.G * src.A + old.G * factor,
	src.B * src.A + old.B * factor,
	src.A + (old.A * factor)
);
 
user92578
Here's the shading, just the usual blend function
 
user92578
forgot const float factor = 1.0f - src.A;
 
4:02 PM
I instantly see the problem :P
 
Shifted
 
user92578
well what's the problem?
 
@Tyyppi_77 add that then
 
user92578
nono it's in my code, I forgot to post that here
 
4:04 PM
@Tyyppi_77 your pixels are only half-rendered
 
@TheMaskedRebel spill it keep spilling
 
@Tyyppi_77 so I need to see all of your code to know where the problem is but try looking at your rendering
 
user92578
I highly doubt that that is the issue
 
user92578
There would be some recognizable shapes if it was only rendering stuff partially
 
I recognize spaces :| but those aren't shapes
Well... H is consitently the same shape
W is too
@JoshPetrie nice answer
 
user4704
4:09 PM
I try.
 
@TheMaskedRebel we'd like you stop posting images in the following situations:
1) It doesn't add at all to the conversation (Less than 3 keywords in the image match the siuation)
2) You are posting an image / message that is on the screen still from when you last posted it
3) It's not funny. If nobody finds it funny, then it is not contributing, and so fails the test specified in #1
4) The image is just... not appropriate. This one should be a nobrainer.
5) The image is offensive to more than 0% of the people in the room. This one is harder, and is a result of several edge cases
 
user92578
Our stars are also messed up once again @JoshPetrie
 
@Tyyppi_77 that's a different problem
The reasoning for the above 5 situations are as follows:
 
user92578
i know
 
user4704
I'll take a look at them in a second.
 
4:15 PM
- If it doesn't contribute, it makes it harder to follow the flow of chat
- If it is offensive, it actively harms the community by turning away people who would otherwise look here for help.
- If it is not appropriate, it also turns away help seekers
@JoshPetrie do you have anything to add?
 
user4704
Seems reasonable.
 
user4704
I wish the starboard would inline image links or something.
 
user92578
I don't even have to be the one to clean it up but I wish a certain someone actually used stars properly.
 
@Tyyppi_77 X_X don't feed the flame
6) Don't feed the flame. Nobody likes being poked at.
 
user92578
wtf
 
user92578
4:28 PM
@TheMaskedRebel I'd appreciate if you wouldn't do stuff like that. I don't really understand why you would ask me to play in the sandbox, it seems sort of hostile to me.
 
He wants to go where he can not get blamed for abusing chat features
 
Well... you have some courage.
 
user92578
man I really dont get what's wrong with my sampling
 
4:46 PM
does anyone know what is wrong with my code
		public boolean isInBounds(Entity entity) {
			Sphere sphere = entity.getSphere();
			Vector3f sphereCenter = sphere.getCenter();

			float radius = sphere.getRadius();


			for(Vector4f plane : coeficients){
				Vector4f center = new Vector4f(sphereCenter.x,sphereCenter.y,sphereCenter.z,1);
				if(Vector4f.dot(center, plane) >= radius) return false;
			}
			return true;
		}
@Tyyppi_77 You could redo the whole code
 
user92578
what a reasonable suggestion
 
@Tyyppi_77 I meant just the sampling
 
5:44 PM
@TheMaskedRebel Can you describe what symptoms the patient is exhibiting?
Concrete test cases help. eg. When the inputs are [...] then I expect an output of [...] but instead I get an output of [...]
 
6:11 PM
Codereview, what an awesome place ! :D I will certainly be frequenting that and probably annoying the hell out of the regulars :] — Super MegaBroBro 2 hours ago
 

« first day (2866 days earlier)      last day (2157 days later) »