ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Anybody here into non-realtime graphics rendering?



SharkyUK

ClioSport Club Member
I was just wondering if anybody here was into raytracing and/or shared an interest in computer graphics technology? Things have certainly moved on over the years...

0.jpg
computer-ray-tracing.jpg


I recently stumbled across some very old code I wrote (for a basic raytracer) and I've decided to revive it and see where I can go with it. I'll try and get some "in-progress" shots as I go along (time permitting!)

So, any raytracing fans out there or 3D artists that have used Maya, 3DSMax, ZBrush (or CAD software) to produce renders? Or maybe POVRay fans? Feel free to share some pics of your work if you are interested in this sort of thing... :cool:
 

SharkyUK

ClioSport Club Member
I was mainly looking /hinting towards 3D computer generated imagery mate, but please feel free to go ahead if you wish. :)

I'm just uploading some images at the moment of a raytracer I coded up many, many years ago so will post up the [very] early development shots I've just rendered out.
 

SharkyUK

ClioSport Club Member
As mentioned in my first post I discovered an old piece of software I wrote for generating 3D images from basic primitives using simple, recursive raytracing techniques. I've given it a name change; it's now known as "SharkyTracer" (I was never good at thinking up names for software projects) and I've quickly wrapped it up in an MFC / C++ shell using Visual Studio. No screenshots of the interface and UI yet though as there's nothing worth showing.

The first steps were to implement basic point lights, a plane primitive, a sphere primitive, a material system and a simple diffuse lighting model to actually light the scene with. The test environment consists of 6 infinite planes that intersect to form a closed box area in which I placed 3 spheres and 3 coloured lights. The initial results were:

8592796731_ecdd1a809d_o.jpg

Basic - Diffuse Shading by SharkyUK, on Flickr

Following on from this I coded an improved lighting model; and made use of the Phong lighting model and specular material components. This produced the computer generated look and feel we tend to associate with old-skool computer graphics! The results are shown below:

8593897990_7e8656592b_o.jpg

Basic - Phong Lighting by SharkyUK, on Flickr

For the record, the 3 coloured non-descript dots are used to simply show where the light sources are positioned in the world.

Next up, having calculated the basic scene colouring, was to shoot an additional 'bounce' ray from where my light rays hit primitives in the world. This ray could then be used to generate reflections. The following scene was rendered using a trace depth of 2 (primary ray + 1 reflection ray). As we are only performing one bounce, we don't get a true reflections where we have inter-reflections between objects.

8592796549_33a79c2c6e_o.jpg

Basic - Refl 1 by SharkyUK, on Flickr

The same scene was rendered again with a trace depth of 4 - hence we now pick up more inter-reflections between objects:

8593897802_f123dc7a0f_o.jpg

Basic - Refl 2 by SharkyUK, on Flickr

Some objects, like glass and water, allow light rays through them as well as generating reflections. Hence I updated the material properties so that primitives can have a refractive index and thus I can trace refractive rays through them. This resulted in the following image:

8593897772_a971091a02_o.jpg

Basic - Refl, Refr by SharkyUK, on Flickr

At this point in time I had a basic system but the rendered primitives looked a bit floaty due to the lack of shadowing. So... I implemented basic shadowing to give the scene some depth. As each ray is traced from the view point and hits a primitive, I then shoot a ray from that hit point to lights that contribute to the hit object's final illumination. I can then check to see if that fired ray hits another primitive. If it does then it tells me there is an object between the object I hit and the light, hence some level of shadowing is evident. For now my code only renders hard-edged shadows as my current system is not optimised for the additional work needed to generate soft shadows. This is for a future version! The scene now looks like:

8592796813_54b91c25ca_o.jpg

Basic - Refl, Refr, Shad by SharkyUK, on Flickr

For this first body of work I decided to wrap it up by adding some very simplistic fogging to the scene - supporting 3 different distance-based modes (one linear, two exponential). The first is a linear increase of fog density between one distance and another, which results in:

8592796659_90df972c50_o.jpg

Fog - LINEAR by SharkyUK, on Flickr

The second technique uses an exponential falloff as a function of the (distance x fog density), resulting in:

8592796551_dae6ba5a87_o.jpg

Fog - EXP by SharkyUK, on Flickr

The third technique also uses an exponential falloff as a function of the (distance x fog density) squared. This produces:

8593897922_c0c47c2bed_o.jpg

Fog - EXP2 by SharkyUK, on Flickr

And a side-by-side comparison of the three fog modes:

8592796701_c5ab2c22b5_o.jpg

Basic Fog Comparison by SharkyUK, on Flickr

And so concludes the first part of the SharkyTracer revival! LOL! :D
 

SharkyUK

ClioSport Club Member
Carrying on from above, I decided to implement a basic camera system... seeing as the previous version (i.e. the images above) were from a fixed viewpoint looking straight down the +z axis. The new camera system is pretty simple (at least in it's initial form). You specify a position where the camera is located (cameraSource) and a target point (cameraTarget) that you want to look at. You also specify the desired angle of view you desire or a focal length value. From those values I calculate a few other parameters that allow me to construct a view into the world; a view that is aligned along the camera "look at" vector (which we already defined as being cameraTarget - cameraSource).

The following three images show a view of a scene with the camera position and direction remaining constant. The only change is in the focal length, allowing simulation of a wide angle lens through to a telephoto/zoom lens.

This first image is at a simulated focal length of 2.4mm:

8597714857_c809ec8e64_o.jpg

Basic Camera - Normal by SharkyUK, on Flickr

The next image is at a simulated focal length of 1.2mm:

8597714889_5ee3c21a04_o.jpg

Basic Camera - Wide Angle by SharkyUK, on Flickr

And the final image is at a simulated focal length of 6.0mm:

8597714809_78f16da5ab_o.jpg

Basic Camera - Telephoto by SharkyUK, on Flickr
 

Heez

ClioSport Club Member
  Superleggera'd Bean
Only thing I have on the laptop.

18_zpsbdcc901c.jpg


Only really use Maya to model something to show how things look and function. Never played too much with rendering, it's something that I want/need to look into I think!
 
  265
Thats some good work there Sharky :approve:

I have a huge amount of rendering coming up with an animation im creating in Blender and the Cycles render engine. Many sleepless nights lay ahead for me as i only have a few weeks left to have it finished.
Ill post some screens up here as im going if you want.
 
  AB182, Audi A5 3.0
Used to be a Maya person, but have recently switched to Blender, which I must say is very good in its current form! Still at the early stages of getting to grips with it though. So Sharky, you have written your own 3D design/rendering tool?! That pretty impressive to say the least!!!!! Your results look amazing as well! Well done.
 

SharkyUK

ClioSport Club Member
I used Cinema4D for a few months after coming to grips with it, Very happy with the rendering settings and how it turned out for my first couple of attempts lol!
I'm not at all familiar with Cinema4D but it sounds like you're getting on well with it. Get some of your attempts/images posted up mate... :)

Only thing I have on the laptop.

<snip>

Only really use Maya to model something to show how things look and function. Never played too much with rendering, it's something that I want/need to look into I think!
The Bismarck project looks interesting - thanks for posting up. I have only touched the surface with Maya as my background is more programming than artist/modeller but I'd like to get into it more; i.e. to actually have a go at designing and building a 3D scene rather than just working on the technology to render and display it.

Thats some good work there Sharky :approve:

I have a huge amount of rendering coming up with an animation im creating in Blender and the Cycles render engine. Many sleepless nights lay ahead for me as i only have a few weeks left to have it finished.
Ill post some screens up here as im going if you want.
Thanks mate. :) Yeah, I guess sleep is something you won't have much of in the foreseeable future! But I'm sure it will be worth it. I quite like Blender when it comes to prototyping and experiments as it's cheap and relatively easy to use (at least for the basics, which is as far as I usually get). That's why I like it for homebrew stuff. In work things are a bit different as we have a render farm that our 3D artists use for production stuff.

Yes, please do post up some screens mate - always interested to see what people are doing. :)

Used to be a Maya person, but have recently switched to Blender, which I must say is very good in its current form! Still at the early stages of getting to grips with it though. So Sharky, you have written your own 3D design/rendering tool?! That pretty impressive to say the least!!!!! Your results look amazing as well! Well done.

Hi mate and thanks for replying. Can I ask why you switched to Blender? (Just curious!) At least you won't be wanting for information, help and possible inspiration; the Blender community is massive it would seem!

To answer your question, yes - I've written my own design/rendering tool. Although it's probably a little too early in the day to call it a tool! The images I posted above are more to show off the raytracing algorithms that I wrote. I'm currently working on a tool framework into which I will drop my raytracing engine. As the code is several years old I'm also in the process of updating it as I have various directions I'd like to take it - multi-threaded, symmetric processing, etc. It's enjoyable to be working on this stuff again after so many years. Since 1998 I've been spending most of my time working on realtime 3D graphics technology so this is a rather nice diversion.
 
  AB182, Audi A5 3.0
Hi mate and thanks for replying. Can I ask why you switched to Blender? (Just curious!) At least you won't be wanting for information, help and possible inspiration; the Blender community is massive it would seem!

Quite simply down to costs. I used Maya for free under a student licence when I was at uni for 4 years, but now I'm not in that bracket anymore I was forced to jump ship. I was playing around with the camera tracking tools in Blander the other day, pretty impressive stuff! your ray-tracing engine is doing an amazing job graphically by the looks of it, but how is it on speed? Are you planning to release it as an external ray tracer like Yafaray in the future?
 
  AB182, Audi A5 3.0
Just found a render of something similar I did when I first started playing with transparency and mirror reflection in Blender...

test2.png


left sphere and cube are glass.
 

SharkyUK

ClioSport Club Member
Quite simply down to costs. I used Maya for free under a student licence when I was at uni for 4 years, but now I'm not in that bracket anymore I was forced to jump ship. I was playing around with the camera tracking tools in Blander the other day, pretty impressive stuff! your ray-tracing engine is doing an amazing job graphically by the looks of it, but how is it on speed? Are you planning to release it as an external ray tracer like Yafaray in the future?
Ah, that makes sense. It's quite difficult to foot the cost of a Maya package/licence!

My raytracing engine isn't too quick at the moment as I'm using only the most basic spatial subdivision technique for splitting up my scene into manageable chunks (i.e. a regular grid). I will be moving to a KD-Tree setup soon all being well but I've got other things I'd like to get working before the move. Having said that, for very simple scenes it runs quite well. The images I presented above render within a few seconds at 1280x720 on a decent PC so I'm happy with that for now. My main aim is to implement new techniques and refine my existing algorithms before taking it up a level. For example, I'd like to implement basic texture mapping, procedural texture mapping, different lighting algorithms, and so on.

When it's a little more complete I may well release it; either as a package or simply the raytracing engine module itself. That's a long way away though... :)

Cool render by the way. Cheers!
 

SharkyUK

ClioSport Club Member
I had a few hours to myself this afternoon whilst my better half was working so I decided to implement basic texture mapping for the sphere and plane primitives. The texture coordinates are auto-generated directly from the primitive geometry. First up was the sphere primitive where polar coordinates were used to determine the correct (u,v) offset into a texture. The result was:

8603523891_9a1f772e70_o.jpg

Texture Mapped Spheres by SharkyUK, on Flickr

Next came the plane primitive. This was actually easier than imagined. I calculated two additional axes for the plane that represented the texture u- and v-axis. All I had to do then was drape the texture across the plane using a simple multiplication of the dot product between a position on the plane and the u- and v-axes and a scaling factor (which I store in the material). Ultimately this allowed me to repeat texture a plane to infinity and I could scale the size of the texture by altering the scaling properties in the material I assigned to the plane. The result:

8604624950_560cff2bfd_o.jpg

Texture Mapped Planes by SharkyUK, on Flickr
 

SharkyUK

ClioSport Club Member
All this talk about different axes and planes - I bet your spatial awareness is pretty damned good. Are you good when driving on track then? :cool:
I'm told I have good spatial awareness (probably from all the sport and trampolining I did when I was young...) :eek: However, I can categorically state that this does not necessarily translate into being a capable track driver! I don't think I'm bad but I'm no Damon Hill (apart from slight facial resemblance)!

I do renders for customers kitchens.

They're nowhere near as good as some of the renders produced though.

6959637990_44091ec58b_c.jpg
That looks good, mate - do you use 'off-the-shelf' software or is it a custom product? Out of interest, how long did the scene take to render?
 
I use ArchiCAD SE11 to do the modelling, then Artlantis Render 4 to do the renders, so off the shelf stuff.

They usually take about an hour or two at 12288 x 8192, depends on how complex the model is.
 

SharkyUK

ClioSport Club Member
Nice and high-res - as it should be :) Thanks for the information and posting up the pic. I have to confess to having a bit of a CGI fetish. :eek: Keep up the good work mate - looks very professional.
 

Darren S

ClioSport Club Member
On a totally seperate note, yet slightly related - I saw that new animated film The Croods over the Easter weekend. Being slightly geeky about what was on screen, I was very impressed with some of the smoke and water effects in the film. Ok, no doubt they will have a whole team of animators and mega-workstations processing it all - but even so - still very good to look at.

I wouldn't even know where to begin with any of that!? :eek:

D.
 

SharkyUK

ClioSport Club Member
I've not seen The Croods yet but it's on the "to watch" list. :) I've seen the trailer for it a few times though and it looks great; there are some really talented modellers and animators out there.

I think that the visuals [in these types of movie] have come on a long way over the last 2-3 years. Often, it's not new technology we are seeing - many of the ideas and algorithms have often been around for years - but the growing computing power available to perform the necessary calculations to render the scenes now means a lot of this is feasible. One of the biggest improvements (for me at least) is in the lighting; the fact that objects in a scene actually look like they should be there rather than appearing disjoint due to incorrect, or incomplete, lighting models being applied to them. Global illumination, photon mapping, radiosity, occlusion, etc. and variations, or extensions, of those techniques result in more 'natural' looking lighting and the result is a lot more pleasant on the eye. We are also seeing more and more of this in games these days.
 

SharkyUK

ClioSport Club Member
It's very clichéd but I couldn't resist doing my own version of the 'shiny balls on a checkered plane' shot. All I've done is implement a few optimisations to speed things up a bit and added a simple skybox to provide some nice environmental reflections.

8622417921_f2db68b383_o.jpg

Raytraced Cliche by SharkyUK, on Flickr
 
You seem very talented. Especially like the above image. Is it something you can pick up easily enough or is it a case of years of practicing?

(Sorry if you've already said, but I'm tired and was just looking at the pictures :))
 

SharkyUK

ClioSport Club Member
You seem very talented. Especially like the above image. Is it something you can pick up easily enough or is it a case of years of practicing?

(Sorry if you've already said, but I'm tired and was just looking at the pictures :))
Thanks for the very kind words, mate - next time I'm visiting my parents in Mansfield I'll buy you a pint! :)

I'll be honest. I'm an old f4rt and I've been programming and messing with computers for near on 30 years. I fell in love with programming and that's what I've done professionally (and as a hobby) since I was 7-8 years old. I also enjoy art and studied graphic design; hence I enjoy combining the whole technical/artistic thing and this possibly explains my passion for most things computer graphics related. So, to answer your question, it's been a lot of hard work, research and experimenting / practice.
 
  04BGFF182CLIORS
Used MAYA a fair amount at Uni' and did a 3D modelling/animation peice for my final year project but havnt touch it since (I now work in print design)

It is something I want to pick up as a hobby though, I downloaded Blender last week but have yet to really try it out.
 
Thanks for the very kind words, mate - next time I'm visiting my parents in Mansfield I'll buy you a pint! :)

I'll be honest. I'm an old f4rt and I've been programming and messing with computers for near on 30 years. I fell in love with programming and that's what I've done professionally (and as a hobby) since I was 7-8 years old. I also enjoy art and studied graphic design; hence I enjoy combining the whole technical/artistic thing and this possibly explains my passion for most things computer graphics related. So, to answer your question, it's been a lot of hard work, research and experimenting / practice.

Haha cheers mate :)

I did Graphics/ICT at GCSE and A level so I think I know the bare basics but it was nothing compared to this. Hopefully if I remember what to do I'll have a go at something similar :) I haven't attempted creating anything on the computer for quite a few years though so I'm not hoping for anything amazing!
 

SharkyUK

ClioSport Club Member
Used MAYA a fair amount at Uni' and did a 3D modelling/animation peice for my final year project but havnt touch it since (I now work in print design)

It is something I want to pick up as a hobby though, I downloaded Blender last week but have yet to really try it out.
Maya (and to a lesser extent, 3DS Max) were used massively when I worked in the games industry (and they still are). It's a shame the cost is so prohibitive (in terms of buying it as a hobbyist) but they are impressive pieces of software. As for Blender, I have it installed but still need to spend some time actually playing with it. There's a shed load of tutorials, guides and resources out there... but just very little time from my end! Poor excuse I know...

Haha cheers mate :)

I did Graphics/ICT at GCSE and A level so I think I know the bare basics but it was nothing compared to this. Hopefully if I remember what to do I'll have a go at something similar :) I haven't attempted creating anything on the computer for quite a few years though so I'm not hoping for anything amazing!
Yeah, just jump in and give it a go! As hinted at in my reply above to martynzs, the biggest problem is finding the time these days. Most people already have such hectic day-to-day lives that finding the time (and enthusiasm) can be difficult.
 
  04BGFF182CLIORS
Maya (and to a lesser extent, 3DS Max) were used massively when I worked in the games industry (and they still are). It's a shame the cost is so prohibitive (in terms of buying it as a hobbyist) but they are impressive pieces of software. As for Blender, I have it installed but still need to spend some time actually playing with it. There's a shed load of tutorials, guides and resources out there... but just very little time from my end! Poor excuse I know...

Exactly my excuse! I really enjoyed MAYA and keep meaning to start using it again in my spare time, but cost (really tricky to crack on MAC) and the fact that the free alternatives are looking just as good makes me think its worth learning just to stay legit.

I found this which seems helpful (assuming you know Maya)

http://vimeo.com/7035569

 
  1eight2
These look amazing!

I'm an Architectural Technician at the moment and barely do any concept work. Would love to incorporate stuff like this, I currently use Sketchup and sometimes play with it in PS but never to this scale.
 

SharkyUK

ClioSport Club Member
Exactly my excuse! I really enjoyed MAYA and keep meaning to start using it again in my spare time, but cost (really tricky to crack on MAC) and the fact that the free alternatives are looking just as good makes me think its worth learning just to stay legit.

I found this which seems helpful (assuming you know Maya)

http://vimeo.com/7035569

Thanks for the link - that video might come in useful whilst getting to grips with Blender... :)

These look amazing!

I'm an Architectural Technician at the moment and barely do any concept work. Would love to incorporate stuff like this, I currently use Sketchup and sometimes play with it in PS but never to this scale.
LOL! I read that as 'ketchup' the first time through... :eek: Either way, it's not something I've used. Apart from 'ketchup' which I've used several times; mainly on my chips. Any images you can share?

I haven't had much time to work on my home project recently but I did make a start on a 3D mesh / model / scene importer. At the moment the materials are hard-coded (along with the textures) but the vertex and polygonal data are parsed from a file. Nothing too fancy here yet, but a couple of screenshots with low-poly 3D character models show a bit of progress...

8643864424_7441f31024_o.jpg

Mesh Importing by SharkyUK, on Flickr

8643864362_c17cf6bc31_o.jpg

Mesh Importing by SharkyUK, on Flickr
 
  1eight2
Sketchup is a really simple tool, especially if you can use CAD. This is a model in its 'raw' form.
view%u00252B10.jpg

Using rendering plugins you can make it look much better;

renderinternet.jpg
 

SharkyUK

ClioSport Club Member
I decided to invest a bit more time working on the import of models/meshes into my rendering software. To get the ball rolling I implemented a simple OBJ file format parser. This file format is VERY old and not really used these days (it's too limiting given the advanced state of today's CGI) but it provides a basic (and quick) framework from which I can quickly introduce polygonal meshes into my software. My parser does not support the entire OBJ file format specification (nor the associated MTL material template library files) but it covers the basics.

Here are a few images of models that I imported and then rendered with my raytracing engine. No textures on these models, the aim was to simply get the polygonal data (vertices, faces) displaying reasonably well...

8653624014_3ed216c330_o.jpg

Mesh / Model Importing by SharkyUK, on Flickr

8652522689_1574030eb6_o.jpg

Mesh / Model Importing by SharkyUK, on Flickr

8652522779_a4fb7dfdb1_o.jpg

Mesh / Model Importing by SharkyUK, on Flickr

8653623934_6681321efc_o.jpg

Mesh / Model Importing by SharkyUK, on Flickr

I'm hoping to look into some more advanced uses of texturing when I next have time, ideally to implement normal maps, bump maps, specular maps and so forth.
 

Rubicon_

ClioSport Club Member
  Defender 110
Some great work, making me want to learn more! The satisfaction of knowing you have created a rendered place or model etc is amazing!

I used sketch up a few years ago and then used various plugins to render, i initially wanted to create an animation but soon learned how ridiculously long it was going to take lol
 

SharkyUK

ClioSport Club Member
Just for the record, I should point out that I didn't model the above vehicles! I am only writing the software/rendering technology to display them so I can't take any credit for the actual modelling. I'm much more a coder than an artist I'm afraid. :)

Anyways, I decided to just add a new feature before I went to bed (hence it's now gone 2am in the morning...) and that new feature is supersampling to help reduce 'jaggies'. Hence, I can now choose to render with 4x supersampling (antialiasing) should I choose to do so. It hits the performance a fair bit though! As a last test before retiring, I decided to stress test my renderer to see if it could cope with hi-poly models. In both of the tests below I rendered the scenes at 1280x720 with 4x AA, shadows and Lambert diffuse shading with a Phong lighting model (although I have reduced the size of the images for sharing on the web).

This first test model is ~110k polys so not really that high in terms of poly count. It took about 3 minutes to render.

8652965833_28c640c6b7_o.jpg

Hi-Poly Test 1 by SharkyUK, on Flickr

This second test model is ~1.3 million polys... It took about 35 minutes to render. Each detail, skin pore, weave, etc. is modelled with 3D polygonal geometry hence the rather realistic result (and the lengthy render time).

8654066782_2a4256fdda_o.jpg

Hi-Poly Test 2 by SharkyUK, on Flickr

I have to admit I'm quite chuffed with this image (above) as I didn't expect my engine to cope with it still being in it's early days of development. :)
 

SharkyUK

ClioSport Club Member
Good question, D... these are actually generated on my old home development PC. And when I say old, I mean old! Athlon dual core, 2GB RAM, nVidia 8800 GTX's in SLI, dual Velociraptor hd's, running 32-bit Windows XP! The thing is, this is the most reliable PC I have ever owned hence I'm reluctant to bin it! I also know that if my code works well on this machine then it should run a fair bit nicer on something more modern. ;) For the record, the ~1.3 million poly head rendered in around 5 minutes on my work PC.
 


Top