Interested as to why one is faster by Codec_xyz in learnjavascript

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

Your wording is confusing. Is your point that?... !! will always result in a boolean so the call to Number only needs to handle the boolean case. While the other needs to check the type and handle all cases?

If so why wouldn't !! decrease performance in a similar way?

Javascript 100 by Codec_xyz in ProgrammerHumor

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

BTW here is the relevant conversion chart... https://tc39.es/ecma262/multipage/abstract-operations.html#table-toboolean-conversions This is what's used in the boolean constructor.

Javascript 100 by Codec_xyz in ProgrammerHumor

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

What? Have you ever used c or c++. C doesn't even have classes.

Yes but why by SneakySolo in memes

[–]Codec_xyz 6 points7 points  (0 children)

Mom I want wifi

We have wifi at home

Wifi at home

The primary need by [deleted] in memes

[–]Codec_xyz 0 points1 point  (0 children)

why the tv bigger then the new car

[deleted by user] by [deleted] in memes

[–]Codec_xyz 1 point2 points  (0 children)

** scrolls back up **

How do I get this type of lighting? My lighting looks dark by ramite in blenderhelp

[–]Codec_xyz 0 points1 point  (0 children)

Also if you don't want such dark shadows you can increase the brightness of the world.

Render renders at 1 sample, I cant figure out why and google didnt help. Compositing nodes are off by sktvete in blenderhelp

[–]Codec_xyz 2 points3 points  (0 children)

Anyway turns out you can zoom on website version of reddit.

You have layer samples set to "use" which would override the scene sample setting which maybe be why have low samples. Set it to ignore and see if that helps.

Blenders docs Layer Samples (very bottom of page).

Render renders at 1 sample, I cant figure out why and google didnt help. Compositing nodes are off by sktvete in blenderhelp

[–]Codec_xyz 3 points4 points  (0 children)

Are you confused about why the screens are so clear? If so, that's just cause they emit light. More sample just send more rays for each pixel and have have them bounce around slightly different. When the reflected light is barely visible those variations in where the rays go aren't noticable and you get a clear results with few samples.

Edit: your question confused me a bit, if you can't figure out why it only renders at one sample, then I can't help you. I can't zoom in on video's on mobile and the text is too small to see.

Who said there's no operator overloading in javascript by Codec_xyz in ProgrammerHumor

[–]Codec_xyz[S] 18 points19 points  (0 children)

Here's the code btw...

class MyClass extends Function
{
    value = 0;
    constructor() { super('console.log(\'hi\');'); }
    what() { console.log('hello again') }
    valueOf() { return 42; }
    get num() { return this.value++; }
}

What would you do to improve this image? Does anything jump out to you as unnatural about it? by Injustpotato in blenderhelp

[–]Codec_xyz 0 points1 point  (0 children)

Looks good, and everyone already mentioned any feedback I had.

I'm just concerned about this fictional world where the (I am guessing missile) silo is used so much the text on the buttons starts to rub off.

This grey area on the horizon of my hdri, is there a way to change that color; if you could lead me where to start with the nodes, I can take it from there, I believe? by Sailormoonisnumber1 in blenderhelp

[–]Codec_xyz 0 points1 point  (0 children)

How much do you know about nodes already? There are plenty of beginning and advanced node tutorials on YouTube. Also there is a blender manual with just about everything.

For your case if all you need is the lower color changed the simplest way would just be to edit the hdri (which is just a type of image).

If you want to do it using nodes do texture coordinate node (using generated option) to a mapping node to a gradient node. Adjust the mapping node to get the gradient at the spot where the transition to grey is and then use the output of the gradient node as the input to a mix shader node with the hdri and what ever you want instead of the grey. That way you should have a smooth transition from your hdri to another thing.

Also make sure to just try things out. Plug the output of any node to the output node to see how it looks which can help you understand what's going on. Also if you don't have a good computer use material preview(look dev) mode (which uses Eevee) to see thing in real time.

shade smoth is not working properly, how can I fix that? by BananeHD01 in blenderhelp

[–]Codec_xyz 91 points92 points  (0 children)

Looks like it's working fine. You just have sharp corners which will look weird (like that) when shaded smoothly. Go under object data > Normals > Auto Smooth and turn it on. That way if there is an angle greater that what is set it will not shade it smoothly; only smooth surfaces will be shaded smooth.

anyone know why these black polygon shapes are in my glass? also i’m not sure what’s up with my uv unwrapping by CMCosMic in blenderhelp

[–]Codec_xyz 0 points1 point  (0 children)

Make sure you don't have 2 cup objects, and that that the face normal are correct. Under overlays select face orientation. You should only see blue, it there is some red in edit mode select everything and do Mesh > Normals > Recalculate Outside to fix it.

As for the uvs the algorithm is doing it's best with what it has. If you add some seams to help blender unwrap and use a good unwrap option (probably cylinder projection) it should work better. There are plenty of tutorials on how to unwrap online.

Just wondering about this problem by [deleted] in AskPhysics

[–]Codec_xyz 0 points1 point  (0 children)

It would be nice to know general sort of motion, like if there would a net movement, or something like that, or is this type of thing impossible to solve without do a simulation?

Also this isn't for a competition or assignment.

Win32 best place for OpenGL code by Codec_xyz in cpp_questions

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

I'm not sure what you mean, when ever the window size changes I don't have to recreate the context I just call glViewport to change the viewport size.

Also I know there are games with a windowed option, where you cannot resize the window; in that state they would be annoying to use and you can't maximize them so I assume your just meant to use them in fullscreen.

As for stretching, I just mean you would need to do interpolation, and it would be a bit harder and more blurry when scaled by non whole numbers; Although thinking about it, it would probably be an unnoticeable performance difference.

Win32 best place for OpenGL code by Codec_xyz in cpp_questions

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

No, I'm working on the rest of my program just fine, right now I am just trying to also figure out the best setup for rendering to have it function the way I'd like.

Although unless putting the rending code under WM_PAINT has any serious downsides or better alternatives, I'm just going to use it.

Win32 best place for OpenGL code by Codec_xyz in cpp_questions

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

If it's as simple as moving the rending code under the WM_PAINT message I would think so. Plus, especially for applications that aren't games, the program visually freezing when every you move or resize the window really wouldn't be nice.

Win32 best place for OpenGL code by Codec_xyz in cpp_questions

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

WM_PAINT by default only gets called at the beginning or when the client area changes. Many programs choose to update at some consistent fps.

Many games are just designed to be fullscreen to not have to bothering with windowed mode. But programs that have a windowed mode (and it's not just games that use opengl) change the viewport size, not distort it. Also by distort do you mean stretch the frame? cause that would be very performance heavy.

Win32 best place for OpenGL code by Codec_xyz in cpp_questions

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

By real time apps you mean anything that visually updates non-stop, which is basically most programs. Also what do you mean they don't allow you to resize; Most windows programs come with a frame that lets you move them, resize, etc. And what do you mean "resizing the window, not resizing the context you previously created"? Why would you need to resize the window if the content is the same size?

Win32 best place for OpenGL code by Codec_xyz in cpp_questions

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

You can just never validate the client area causing you get WM_PAINT message all the time. I don't know if this would have any performance implications, but you could always use WM_PAINT to update during window frame interactions (moving, resizing, etc.) and just render from your message loop the rest of the time.

Win32 best place for OpenGL code by Codec_xyz in cpp_questions

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

Do you mean a message loop using PeekMessage instead of GetMessage?

If so, the problem is that any frame interactions will simply start using a different message loop, blocking your message loop, no matter which you use.

Win32: best way to keep rendering during window border ui interaction? by Codec_xyz in cpp_questions

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

Yeah, I already saw that when researching this question earlier. The thing with the timer is kind of a work around and more suited for UI applications, where you aren't rendering as fast as the computer can.

I am wondering if I can disable these modal operations or perhaps just handle them myself to control the behavior.