« first day (577 days earlier)      last day (4372 days later) » 

6:00 AM
@SethCarnegie remember when i said you should be using regions
 
so ------------>( ) ---k^2 rays-->
 
I'm not sure what the rationale here is, why you would do that in other words. what do you mean by "original reflected ray"
 
@johnathon it's just seems weird that this isn't done every day
 
WS_EX_TRANSPARENT
0x00000020L



The window should not be painted until siblings beneath the window (that were created by the same thread) have been painted. The window appears transparent because the bits of underlying sibling windows have already been painted.

To achieve transparency without these restrictions, use the SetWindowRgn function.
 
6:01 AM
It seems like a sophisticated operating system such as Windows would easily support transparency
 
@SethCarnegie it does, SetWindowRgn
 
In order to obtain glossy reflection, in addition to the antialiasing of the previous case, you use k^2
rays for each original reflected ray
 
@johnathon how would that be used
@johnathon I don't see how it's different than setting the clip region or something
 
@ladiesMan217 your worst case is horrible. exponential on top of exponential
 
thats what it says..I called up my instructor to ask him clarify this and he says he is drunk lol
 
6:02 AM
roflol
instastar
 
he is the worst case instructor in my opinion lol
 
@SethCarnegie question
 
@ladiesMan217 lol worst case instructor
 
@ladiesMan217 so let's pretend we are a pixel. we shoot out a ray and determine an intersection with a point in space, p. so we try to see if we can see the first lightsource, l1
 
lets just "exponentiate" our worst case
 
6:03 AM
@SethCarnegie now, the drawtext method is going to obscure the line a little bit, is that ok?
 
@johnathon you mean the text will be outlined a little
 
@SethCarnegie because i got it working i think the way you want
 
@ladiesMan217 our ray that we cast from p to l1 hits a reflective surface - let's call this p2
@ladiesMan217 p2 now needs to shoot out N_L rays (one to each light source)
where does k^2 come in here?
 
@SethCarnegie yea, the drawtext is done after the line is drawn, so its going to paint over the line
 
So for each N_L ray that may reach p3
 
6:05 AM
@johnathon I'd have to see it
 
there will be k^2 more rays from p3
 
so basically each reflective surface itself is antialiased
...
roflol
 
hahahahaha
 
I don't get it
 
6:06 AM
so our current equation is (k^2 - antialiasing) * ((N^2 - pixels) * (N_L ^ d - lightsources to the power of tree depth))
k^2 * ((N^ 2) * (N_L ^ d))
 
N_L ^ d is the part that deals with reflections
 
@SethCarnegie see that?
 
@johnathon yeah, that's a problem with TextOut though I think, isn't it?
 
my brain is full of fuck @stdOrgnlDave X_X
 
6:08 AM
If I use DrawTextEx it shouldn't do that I think
 
ugh, give me a minute
 
@SethCarnegie yup, it is, take clip siblings out of your parent windows properties
 
so what you can reckon from the link I sent you
It has that particular case in it
 
@johnathon siblings or children?
 
6:08 AM
@SethCarnegie then anything you draw in the child will just draw over what the parent drew, effectively making it "transparent"
 
OK sweet
 
children dur
 
how'd you get it working like that
 
@stdOrgnlDave CRT + F " Reflection anti-aliasing "
 
@SethCarnegie HWND wnd = CreateWindowEx(NULL, "test_window", "test", WS_VISIBLE | WS_OVERLAPPEDWINDOW, 50, 50, 400, 400, NULL, NULL, hinst, NULL);
 
6:11 AM
@ladiesMan217 think I got it figured out, writing down reasoning
 
Thanks a lot pal . Whatever motivates you to help me, I need that potion :D
 
@SethCarnegie is that what your after?
 
@ladiesMan217
n*n - for pixel buffer
n*n * N_L - each pixel needs N_L extra rays for lighting calculation
n*n * N_L ^ d - each N_L ray may intersect with a reflecting surface, each of which needs N_L more rays, to a limit of d intersections

each reflection point however needs to reflect k^2 rays. so, instead of N_L, we get (N_L * k^2) ^ d

in our lighting equation

k^2 * (n^2 * N_L^d) we substitute (N_L * k^2) ^ d, yielding

k^2 * (n^2) * ((N_L * k^2) ^ d)
corrected that
 
I was doing that same exact equation too...Makes me feel not so stupid following a drunk instructor :D
 
6:14 AM
@johnathon I think so, I'm just seeing a few things
 
@SethCarnegie the flickering requires double buffering in both the parent and child
 
yeah definitely
 
@ladiesMan217 so how much worse does it get
 
@SethCarnegie however, if thats the transparancy thing ya wanted to do , then yes, thats all you need to do to do that
 
well we know refraction is now "forever alone"
but not for long
he needs some dose of k^2 too
 
6:15 AM
"forever alone"?
I've treated refraction the same as reflection in these cases
 
@SethCarnegie im sorry i had to think on it, it's been a minute sense i dident want to litterialy make a window inside a window to do anything other than divide up realestate on the main window
 
both are simply a redirection of the ray
 
In order to obtain not only glossy reflection, as in the previous
case, you also decide to implement translucent refraction by replacing each refracted ray by k^2 rays.
oh shit, did we not include refracted ray for our normal case without anti aliasing
?
 
@ladiesMan217 is there some reason that we should not have been making refraction and reflection equivalent?
 
Doesnt say that here
 
6:17 AM
refraction and reflection both simply change the direction of the ray
 
@SethCarnegie also to note, if you disable the erase background message, it helps with the flickering
 
It says, if necessary, give multiple "sigma notations"
 
@johnathon Yep, got it all working :D
you can use SetBkMode(hdc, TRANSPARENT) to get the background to not be gray
 
@SethCarnegie good deal, now wheres your question post?
 
let me find it
 
6:18 AM
@SethCarnegie um.. Dude the background on my side is white
 
1
Q: WM_EX_TRANSPARENT doesn't repaint child windows

Seth CarnegieI am using the WM_EX_TRANSPARENT window style on some windows in an attempt to do double-buffering with transparency. However, I am having a problem because when I do InvalidateRect on the parent window, the child windows are not redrawn. Is it the parent window's responsibility to iterate the c...

@johnathon well makes no difference
 
I can gurantee you @stdOrgnlDave that this is THE LAST case of this problem
 
@ladiesMan217 I'm not sure that it changes the case any, though
 
Yeah, I was wondering the same thing..
 
@ladiesMan217 wait what was the wording of the previous one?
the exact wording?
 
6:21 AM
@SethCarnegie posted bro
 
you mean for the refraction case?
 
no the one just before it
 
) In order to obtain not only glossy reflection, as in the previous case, you also decide to implement translucent refraction by replacing each refracted ray by k^2 rays.
 
@johnathon unfortunately it's only eligible for a bounty in two days, I will award you the 250 as promised whenever it lets me
 
I dont understand
 
6:23 AM
if for some reason I forget then you can find me in here and remind me
 
"translucent refraction"????
 
@johnathon oh no, make that one day
 
@SethCarnegie it's cool
 
@ladiesMan217 no the one before that
 
@SethCarnegie your company looking for help?
@SethCarnegie i could use some more work :))
 
6:24 AM
Haha, if we ever have a position then I'll make sure to recommend you
 
"In order to obtain glossy reflection, in addition to the antialias-ing of the previous case, you use k^2
rays for each original reflected ray."
so when we implmented that k^2 for original viewing rays, we then came to the above case
for which you introduced (N_L * k^2) ^d
 
@ladiesMan217 oh crap, a refracted surface gives us both a refraction (translucent) and a reflection
 
yup....I was gonna add that too
 
so our old worse cases need to be updated, since a reflection now needs to be 2* in case it's a refraction
(N_L * k^2) ^ d for non-raytraced becomes 2(N_L * k^2) ^ d
stupid f*cking refractions bastards
 
hahahaha
btw, where are you from? if I may ask
 
6:29 AM
northeast USA
it's 2:30AM and I have stayed up to help you with this
 
oh..New England area?
I appreciate it man
 
if you had more rep I would ask you to post a question with a bounty lol
anyhow
 
hello people
 
hahah sorry, such questions dont get answered really quick and without additional chatting. But I will send you an invite on my further question regarding my next assignment.
Let me bookmark you
 
you need to go back to where we started worrying about reflections in our calculations and make *2
 
6:30 AM
wait what
 
let's go through a b c d e again
list each in order and I'll show the difference
 
okay
 
i have this problem... in which i want to optimize a program i've written
the problem is.. i am reading an input file
 
(a) "One viewing ray per pixel, ambient light only"
 
@knowledgeSeeker google on how to desyncrhonize STL files with C files
 
6:31 AM
the input file is 4096X4096 matrix of 1 byte integers
 
@ladiesMan217 (a) N^2
 
@johnathon the child windows still flicker though even when I doublebuffer them (aside from having a non-transparent background) :(
 
(b) " One viewing ray per pixel, shadow rays for each of NL point
light sources, no reflection or refraction rays."
 
@ladiesMan217 (b) n^2 * N_L
 
you've already been a lot of help though so if you need to leave then no problem
 
6:33 AM
normal read write (fscanf) takes me to around 2 secs for reading a file
i want it within 1 secs.. possible?
 
(c) One viewing ray per pixel, shadow rays as above, reflection and refraction rays to a maximum tree depth of d.
 
@SethCarnegie cache your bitmap, call defwindow proc on your mem dc before you bitblit it back to the main dc, that will help with the flicker
 
@johnathon ok
 
@ladiesMan217 before we had n^2 * (N_L ^ d) right?
 
@johnathon the child windows still don't get the dc from the WPARAM though
 
6:34 AM
@SethCarnegie also kill the wm_erasebackground, make darn shure windows dosent erase any background on ti
 
it's just 0
 
a reflection counts as 1 ray, but a refraction spawns 2 rays
 
@johnathon yeah I'm just returning 0 in ERASEBKND
 
so the equation is n^2 * (2 * (N_L ^ d))
 
6:34 AM
@SethCarnegie yea, no biggie, just do the same double buffering on it as you would the main window
 
I think in this case "refraction ray" is only talking about the one that transmits through
the object
 
if that's true then we don't need to modify our equations at all
do you see why?
a reflection spawns 1 new ray, a refraction spawns 1 new ray, they are equivalent
 
hmm..because again refraction gives only 1 ray
?
 
ah yes
 
6:36 AM
unless refraction involves 2 rays, which it should, because refractive surfaces are shiny AND translucent
 
"When light hits a transparent surface, we not only see refraction, but we get a reflection off of the surface as well
Therefore, we will actually generate two new rays and trace both of them into the scene and combine the results
"
 
@johnathon should I draw the child windows into the parent window's buffer?
 
If you are talking about refflection "inside the object" then this might be different
 
I am caching and using dwp and it's still flickering quite badly
 
6:38 AM
no
 
Or are you talking of reflection on the surface? I.e, the reflection that is a counterpart of refraction
 
@SethCarnegie let me see if i can smooth this out on my end a lilttle bit and i'll paste the code in pastebin for ya
 
@ladiesMan217 a refraction surface has both a reflection, and where light is bent through it, which means 2 rays. how do I explain this? :-\
 
haha no i get it
 
like water. if there's a shiny light on it you get a shine in your face, but you also get the light that has passsed thru the water and bent
 
6:39 AM
yes now i am enlightened
 
that's what I was doing
 
and so we have already accounted for that refection
 
so we modify (c) to be n^2 * (2 * (N_L ^ d)), the 2 accounts for refraction
 
Now I get it
 
@johnathon just so you know you're not working for your bounty any more, you already have it so don't feel compelled to continue on
 
6:40 AM
let's do (d)
brb real quick
 
(d) "Multiple viewing rays per pixel (k^2). Other rays as in the previous case." :D
 
@SethCarnegie it's cool man i don't mind helping ya nail this down
 
I dont know for the life of me why i put a smiley there
 
@SethCarnegie is there any reason for the shadowed rectangle and the "polyline" in the code?
 
@johnathon the rectangle was so there would be a white background and the polyline is to draw the line
so we can see if the background of the child windows repaints and is transparent, etc.
instead of just being the same color as the background of the main window or something that isn't real transparency
The first rule of C/C++ is that there is no such thing as "C/C++". — Kerrek SB 1 min ago
 
6:44 AM
@ladiesMan217 so for (d) we do k^2 * (n^2) * (2 * (N_L ^ d))
am I right?
its late lol
 
haha you are 100% right
 
ok (e)
 
(e) In order to obtain glossy reflection, in addition to the antialias-ing of the previous case, you use k^2 rays for each original reflected ray
 
this is whats stupid
it complicates things
our previous solution had ummm
 
i know coz now we need to discern between reflec component and refrac component
i think we can just add?
 
6:48 AM
yes, what was our previous answer to (e)?
no to add, what was our previous (e)
 
it was k^2 * n^2 * (N_L * k^2) ^ d)
 
so
now each reflection does k^2 more, so it is ((k^2 * (N_L ^ d)) + (N_L ^ d))
left = reflected, right = refracted
 
so in this case
 
has somebody been to bitbucket today?
 
yes..i was gonna say adding...sorry i am bit new to this so when i see what i was thinking i feel me gusta
 
6:50 AM
me gusta?
 
like "fuck yea, my thoughts exactly"
 
I wish SO did contests like Gaming does. I wanna win a T-Shirt for knowing useless C++ knowledge!
 
OK so our answer to (e) is k^2 * n^2 * ((k^2 * (N_L ^ d)) + (N_L ^ d))
left-hand of + is reflection, right-hand is refraction
 
where did the 2 go?
 
the *2 summed up the left-right which were equal before we figured out that refraction was 2 rays
 
6:52 AM
oh i see....
 
N_L^d + N_L ^d = 2 * (N_L^d)
 
oh i see
we segragated them and multiplied the k^2 component to the reflection
 
so in (e) it asks for the same k^2 included for the refraction
or let me put it here
In order to obtain not only glossy reflection, as in the previous
case, you also decide to implement translucent refraction by replacing
each refracted ray by k^2
rays.
 
which makes it (k^2 * (N_L ^ d)) + (k^2 * (N_L ^ d))
reflection on the left + a refraction ray on the right
sum them up to simplify you get 2 * (k^2 * (N_L ^ d)) - the 2 comes back
k^2 * n^2 * 2 * (k^2 * (N_L ^ d))
:-(
following along?
 
6:56 AM
wait a sec
so in e
why didnt we do
 
someone star this line I did above: k^2 * n^2 * 2 * (k^2 * (N_L ^ d))
3
 
k^2 * n^2 * (N_L ^d)
 
@SethCarnegie ok i've eliminated all flicker from the parent window
 
what was e again? is that the one we're on?
or are we on f?
 
@SethCarnegie im going to use the same technique to eliminate the flicker from the child
 
6:57 AM
we are on f
 
OK
because we did (k^2 * (N_L ^ d)) + N_L ^ d
 
@johnathon are you going to have to bitblt part of the parent's backbuffer into the child's and then paint on it and then bitblt the child's into its hdc?
 
left of plus sign is reflection, right is refraction
 
yes
and now
we do the same for both
 
yep
(k^2 * (N_L ^ d)) + (k^2 * (N_L ^ d))
 
6:59 AM
@SethCarnegie dunno yet, im just going to double buffer the crap out of it and prevent cache the living heck out of everything
 
simplifies to 2 * (k^2 * (N_L ^ d))
 
and the original Viewing ray
 
component
 

« first day (577 days earlier)      last day (4372 days later) »