• What are you working on? V5
    2,005 replies, posted
[QUOTE=ZomBuster;18385057]Made a simple volumetric raytracer [IMG]http://www.cubeupload.com/files/683a00sphere.png[/IMG] Hard to shade it this way since I'm generating it on the fly.[/QUOTE] Cool, link to paper/algorithm used?
[QUOTE=nullsquared;18385714]Cool, link to paper/algorithm used?[/QUOTE] Didn't use any algorithm or something so it's pretty crude. I just do this for every ray (where C is a color and TM is a libnoise module). [cpp] for(float p = 1 ; p < 1000;p += 1) { Now += ViewRay.direction; float q = (Distance(Now,Vector(imagewidth/2,imageheight/2,500))); if(q < 500) { density = TM.GetValue(Now.x,Now.y,Now.z); if(density > 0.1) { C.r = (1 - (p/500.0f)); C.g = (1 - (p/500.0f)); C.b = (1 - (p/500.0f)); C.a = 1; break; } } } colorpixel(x,y,C); } [/cpp]
[QUOTE=Jawalt;18385272]No, FBIDE is just an IDE, why would you assume I was using it with the version with a bundled compiler that's sooo old.[/QUOTE] Past experience from the official FB forums, that's always the case there. :buddy:
[QUOTE=ZomBuster;18385977]Didn't use any algorithm or something so it's pretty crude. I just do this for every ray (where C is a color and TM is a libnoise module). [cpp] for(float p = 1 ; p < 1000;p += 1) { Now += ViewRay.direction; float q = (Distance(Now,Vector(imagewidth/2,imageheight/2,500))); if(q < 500) { density = TM.GetValue(Now.x,Now.y,Now.z); if(density > 0.1) { C.r = (1 - (p/500.0f)); C.g = (1 - (p/500.0f)); C.b = (1 - (p/500.0f)); C.a = 1; break; } } } colorpixel(x,y,C); } [/cpp][/QUOTE] Oh, interesting.
[QUOTE=ZomBuster;18385057]Made a simple volumetric raytracer [IMG_thumb]http://www.cubeupload.com/files/683a00sphere.png[/IMG_thumb] Hard to shade it this way since I'm generating it on the fly.[/QUOTE] i love you
[QUOTE=Jawalt;18385387]Mind helping me out with the cave/water algorithms? I'm not trying to be competition to you, I'm just bored. :P[/QUOTE] Sure, what do you want to know?
I fixed the problem with pointiness. I lowered the number of points that makes up the terrain, and I made the points only be able to change a certain number of pixels from it's leftmost neighbor. It lowers how many 'spikes' I get by alot. [img]http://i132.photobucket.com/albums/q17/Mattayu/terrain.jpg[/img]
[url]http://synthiac.net/p5/volume/[/url] protip this takes a super long time to load due to the jogl dependency (1.1mb jesus fuck) and the fact that it's java. and i removed the osx natives so [url=http://www.facepunch.com/showpost.php?p=18345342&postcount=89]morons like this can't witness the amazing interactive-ness[/url].
[QUOTE=iPope;18386910]Sure, what do you want to know?[/QUOTE] Just generally how you did it, I'm not sure what I should do. [editline]01:39PM[/editline] Shit my automerge!
Since everybody is doing raytracing, how 'bout some tutorials with spoonfeeding examples?
Did some work on my C++ LargeInt class today...overloaded pretty much all useful arithmetic and comparison operators, still have division to do. Made me think how much we take all mathematical operations for granted :P This is going to help so much with Project Euler :v: [editline]11:01PM[/editline] [QUOTE=Eleventeen;18387608]Since everybody is doing raytracing, how 'bout some tutorials with spoonfeeding examples?[/QUOTE] Seconded
[QUOTE=fngrbng;18387385][url]http://synthiac.net/p5/volume/[/url] protip this takes a super long time to load due to the jogl dependency (1.1mb jesus fuck) and the fact that it's java. and i removed the osx natives so [url=http://www.facepunch.com/showpost.php?p=18345342&postcount=89]morons like this can't witness the amazing interactive-ness[/url].[/QUOTE] very cool & trippy
[QUOTE=Jawalt;18387389]Just generally how you did it, I'm not sure what I should do. [editline]01:39PM[/editline] Shit my automerge![/QUOTE] Well for what your doing I would reccomend looking at this: [url]http://www.gameprogrammer.com/fractal.html#midpoint[/url] Mine is very simple and not a very good way of doing things but works for the purpose of my game. For the land I start with a pixel at the left. I increase the x and then add a random integer between -1 and 1. This creates the land (the "filling" is just because it uses lines). Then it moves on to the more complicated stuff. For water any black pixel under a certain level is coloured blue, then it checks if their is grass tiles on or below sea level, those are set brown again (The grass is generated in the initial land bit, where it sets the current pixel green and it draws a brown line below that pixel to the end of the land). With the cave stuff each light grey pixel is actually a cell, the program loops through each cell processing them. A cell has a random chance to add another cell in a random direction too itself, or die. Any cell completely sorrounded by cells dies. The lava is done like the water. The gems are done by checking each pixel which is not rock, if it has 2 or more rock as neighbours then it has a random chance of adding a gem. The coal veins are done liek the land generation just without the lines, more variation and vertical. Hope that clears some things up for you. My map viewer runs at 5fps with over 1,000,000 blocks being processed at once. I know how I am going to optimize it, its just finding a way to make it work.
I actually based the terrain generation off that, I just had to mess with the values for less jaggedness, eventually I think for rocks I'm going to use some type of interloping to smooth out the edges a bit. That ore I figured was done that way, but I couldn't figure out the caves. That's a pretty cool solution.
[img]https://dl.dropbox.com/u/99765/b8371.png[/img]
[QUOTE=databee;18389017][img]https://dl.dropbox.com/u/99765/b8371.png[/img][/QUOTE] What are you doing to produce the motion blur on the balls?
I just record the last 10 positions of the ball and then draw it again with a lower alpha. Probably not the best way.
If you've got the direction vector stored, why not just draw 10 balls in the opposite direction that the ball is currently going? Of course, tweaking for when it bounces, but it could save some time.
nno
[QUOTE=Jallen;18389060]What are you doing to produce the motion blur on the balls?[/QUOTE] Maybe he just makes more balls behind it and lowers the opacity and size. [editline]08:29PM[/editline] Ooopss late, but I was right! Mhahahah.
[QUOTE=databee;18389365]I just record the last 10 positions of the ball and then draw it again with a lower alpha. Probably not the best way.[/QUOTE] If you render the most transparent first, and work your way up to the actual ball then you can make them much closer together so that it gives you a much more blurry effect and less of a frame overlay effect. So like orange box motion blur instead of the gmod motion blur in the q menu. Depends on what look you want but it looks nice when the frames are very close.
[QUOTE=Eleventeen;18389454]If you've got the direction vector stored, why not just draw 10 balls in the opposite direction that the ball is currently going? Of course, tweaking for when it bounces, but it could save some time.[/QUOTE] I would disagree because I think it'd be harder to determine where the ball bounced from. If the ball hit a block and the block disappeared, the game will have to remember that there was a block there and produce the trails accordingly. As well as this, if the game ever has gravity or some other accelleration of the ball, then the opposite direction of the ball's velocity will not neccesarily be the path it just traveled from. Similarly if the ball can change speed due to a pickup or something. I think the current way of recording the last ten positions is perfectly fine.
[QUOTE=Vampired;18389694]I would disagree because I think it'd be harder to determine where the ball bounced from. If the ball hit a block and the block disappeared, the game will have to remember that there was a block there and produce the trails accordingly. As well as this, if the game ever has gravity or some other accelleration of the ball, then the opposite direction of the ball's velocity will not neccesarily be the path it just traveled from. Similarly if the ball can change speed due to a pickup or something. I think the current way of recording the last ten positions is perfectly fine.[/QUOTE] Agreed. Storing old ball positions requires no calculation, finding out the positions based on its movement vector is calculation based. The current way is best.
TBH when the ball is moving you could just use a pre motion-blurred sprite and face it in the right direction :v:
[QUOTE=garry;18389824]TBH when the ball is moving you could just use a pre motion-blurred sprite and face it in the right direction :v:[/QUOTE] Of course, that doesn't quite work in a pretty way when you have speed and direction changes. But sure, that's cheap and easy. [editline]03:53PM[/editline] [QUOTE=gilly_54;18387919]Did some work on my C++ LargeInt class today...overloaded pretty much all useful arithmetic and comparison operators, still have division to do. Made me think how much we take all mathematical operations for granted :P This is going to help so much with Project Euler :v: [/QUOTE] Having actually designed arithmetic hardware, I know how bitchy mathematical operations can be. Luckily, you're not doing floating point. So what, is this a variable-width integer or something?
[QUOTE=Cathbadh;18389911]Having actually designed arithmetic hardware, I know how bitchy mathematical operations can be. Luckily, you're not doing floating point. So what, is this a variable-width integer or something?[/QUOTE] Now that I've started doing a degree in computer science, a lot of the stuff that you say such as the designing of arithmetic hardware sounds a lot less crazy and complex. It's pretty cool. Also WHY IS YOUR AVATAR NOT THE GREEN THING (I think it was a FET?) [editline]09:11PM[/editline] [QUOTE=Eleventeen;18387608]Since everybody is doing raytracing, how 'bout some tutorials with spoonfeeding examples?[/QUOTE] [url]http://www.codermind.com/articles/Raytracer-in-C++-Introduction-What-is-ray-tracing.html[/url] It's got a set of articles on voxels too. Pretty awesome site.
[QUOTE=Jallen;18390238]Now that I've started doing a degree in computer science, a lot of the stuff that you say such as the designing of arithmetic hardware sounds a lot less crazy and complex. It's pretty cool. Also WHY IS YOUR AVATAR NOT THE GREEN THING (I think it was a FET?) [/QUOTE] Good man. Maybe others here will come to the same senses as you have. Which brings me to why I switched to the Calvin's dad avatar. I felt like I was being hated on for doing things the hard way and telling you to not learn to program with an IDE and not rely on the easy-peasy libraries and pre-implemented algorithms. I'm sure your computer science curriculum will back me up on this. I can relate to Calvin's dad because I feel that "it builds character." Also purposefully misleading uninformed people as a joke. Calvin's dad did this all the time.
[QUOTE=Cathbadh;18390650]Good man. Maybe others here will come to the same senses as you have. Which brings me to why I switched to the Calvin's dad avatar. I felt like I was being hated on for doing things the hard way and telling you to not learn to program with an IDE and not rely on the easy-peasy libraries and pre-implemented algorithms. I'm sure your computer science curriculum will back me up on this. I can relate to Calvin's dad because I feel that "it builds character." Also purposefully misleading uninformed people as a joke. Calvin's dad did this all the time.[/QUOTE] :spergin:
[QUOTE=Cathbadh;18390650]Which brings me to why I switched to the Calvin's dad avatar. I felt like I was being hated on for doing things the hard way and telling you to not learn to program with an IDE and not rely on the easy-peasy libraries and pre-implemented algorithms. I'm sure your computer science curriculum will back me up on this. I can relate to Calvin's dad because I feel that "it builds character." Also purposefully misleading uninformed people as a joke. Calvin's dad did this all the time.[/QUOTE] huh..?
[QUOTE=Pj The Dj;18391574]huh..?[/QUOTE] What exactly is there not to get about his post?
Sorry, you need to Log In to post a reply to this thread.