# Log of /trunk

 Sticky Revision:

Revision 115 - Directory Listing
Modified Sun Jan 8 02:34:23 2012 UTC (7 years, 1 month ago) by jacoblundstrom
- added an attached object list to python ui for scene nodes



Revision 114 - Directory Listing
Modified Tue Jan 3 02:41:03 2012 UTC (7 years, 1 month ago) by jacoblundstrom
- changed box from being a bounds object to containing a bounds object (motivation was to protect against invalid width, height, depth)
- exposed width, height and depth accessors from box



Revision 113 - Directory Listing
Modified Tue Jan 3 02:13:57 2012 UTC (7 years, 1 month ago) by jacoblundstrom
- removed quarter height from cylinder (oops! that was from earlier debugging)
- added box to tex script
- unified sphere and box to be like the other geometric primitive objects (have a create method... kinda silly for sphere, but makes for a uniform interface)
- NOTE: I think all geometric primitives now default to creating a unit primitive at the origin (if oriented, up is 0, 1, 0)



Revision 112 - Directory Listing
Modified Tue Jan 3 01:23:30 2012 UTC (7 years, 1 month ago) by jacoblundstrom
- added a cylinder primitive (note: does not have end-caps yet... will be simple to add... has some rendering issues with complex orientations)
- added test cylinder to tex script
- tweaked plane creation (nothing major, just a create methods to match a constructors and put all width/height setting through the accessors)
- added world AABB test to geometric object (primitive) intersection test... objects were clipped since bounds do not handle orientation yet... so test was commented out unti bounds deal with orientation
- fixed up box primitive well enough to render correctly and texture three sides correctly... note: since box sits at origin, all sides are parallel to the major planes which causes the box not to be lit or receive shadows (as mentioned in the previous commit with planes)
- added some comments to sphere while working on cylinder (since they are very similar)
- tweaked normalize method of vector to mimic what sphere was doing... makes code easier to read and saves about a .25 to .5 secs on all rendered scenes... probably could save a bit more since I know there are other checks doing the same thing



Revision 111 - Directory Listing
Modified Sun Jan 1 07:08:31 2012 UTC (7 years, 1 month ago) by jeremyd
remove tr1 stuff, since apparently MS has fallen down on the job.  Use boost::math instead


Revision 110 - Directory Listing
Modified Sun Jan 1 03:10:02 2012 UTC (7 years, 1 month ago) by jacoblundstrom
- NOTE: fairly large performance hit due to this commit... ray transformation stuff (just about doubles rendering time...  see comments in geometry object onIntersect for mitigation... need to add a world-space AABB test before ray transform for object-space primitive test...  getting about time for kd tree or octree scene management... since we have AABBs, it will be a snap)
- NOTE: strange issue seen when a plane is parallel to the y-z plane... it won't be shaded or have shadows... bump it just slightly off the y-z plane and everything is fine... probably hitting an asymptote during transformation, but I am not seeing where it is happening (I added a bounded plane to the cornell box which exhibits the problem (left side red plane).  Bump its orientation a little and it will be shaded.)
- hooked up object orientation, so now you can rotate the Earth (and any other objects) and see North America... note, once I rotated the Earth, I noticed the texture wasn't lined up properly, fixed that...  Australia looked a little squished before :)
- added ability to set bounds on a plane
- added texturing to ellipsis (cartesian-planar texturing, polar based texturing might be added later)
- since orientation is hooked up, I removed setting the normal on objects in scripts... this should be handled by the scene nodes (which it now is)
- added angle-axis setting in script for orientation
- TODO: add orientation.rotate.x(.y/z) to script for an alternative to setting angle-axis
- tweaked scripts due to changes (textured plane and ellipse in tex.txt)
- fixed quaternion identity constant
- fixed up comments for geometry objects to ensure clients know that they expect and return object-space data



Revision 109 - Directory Listing
Modified Sat Dec 31 08:27:22 2011 UTC (7 years, 1 month ago) by jeremyd
remove unneeded variable from sphere.cpp.  Add -ffast-math back to makefile now that we are successfully avoiding dealing with NaNs


Revision 108 - Directory Listing
Modified Sat Dec 31 08:24:05 2011 UTC (7 years, 1 month ago) by jeremyd
avoid generating NaNs in sphere's getTexCoord by ensuring we do not exceed the domain of the acos function.  Note that I pulled in a couple of C99 math functions via tr1, so make sure that either your compiler is up to snuff already or that you have the boost tr1 include path stuff set up right


Revision 107 - Directory Listing
Modified Sat Dec 31 03:01:29 2011 UTC (7 years, 1 month ago) by jeremyd
Update Makefile: change disk to ellipse.  Remove -ffast-math from gcc flags, since it does not properly handle the IEEE standard in the NaN and Inf edge-cases, which the tex coord code now requires.  TODO: look into NaN handling in OpenCL


Revision 106 - Directory Listing
Modified Sat Dec 31 02:21:13 2011 UTC (7 years, 1 month ago) by jacoblundstrom
- changed disk to ellipse (more generic concept... NOTE: only supports circle intersection, i.e., width and height must be equal)
- removed unnecessary cross product in ellipse intersection (was playing with another idea and forgot to remove it)



Revision 105 - Directory Listing
Modified Fri Dec 30 23:30:08 2011 UTC (7 years, 1 month ago) by jacoblundstrom
- added new geometric primitive: disk (can be used for cylinder and cone end caps, or just another object to play with in the scene)
- added disk to tex script



Revision 104 - Directory Listing
Modified Fri Dec 30 21:43:58 2011 UTC (7 years, 1 month ago) by jacoblundstrom
- tweaked positions of objects in tex script to inspect bump mapping
- noticed bump mapping looked inverted (the Himalayas were rather shaded for the given light position), so added ability to invert the x and y of the bump map (and stubbed it into the normal map)
- exposed inverting x and y for bump and normal mapping in python UI
- renamed some variables in materials panel for consistency in code



Revision 103 - Directory Listing
Modified Fri Dec 30 10:24:00 2011 UTC (7 years, 1 month ago) by jacoblundstrom
- added bump map and normal map to material
- implemented bump mapping (normal mapping is not yet implemented)
- added bump map for earth
- added bump and normal map to python UI



Revision 102 - Directory Listing
Modified Fri Dec 30 06:48:50 2011 UTC (7 years, 1 month ago) by jacoblundstrom
- hacked in sphere textures
- exposed texture through material panel in UI (only use textures with spheres right now)
- added some textures that are fun for spheres
- changed tex scene script to add some texture materials
- stubbed in getting texture coordinate to all movable objects (NOTE: don't know if it will stay this way, but worked for spheres)



Revision 101 - Directory Listing
Modified Fri Dec 30 00:29:19 2011 UTC (7 years, 1 month ago) by jacoblundstrom
- added a few test targa textures (marble and wood.. parkay floor tile even!)
- added test scene file for background textures (just a duplicated scene.txt file with background stuff added to the root node)
- moved background stuff from ray tracer to root node
- moved background stuff from ray tracer panel to scene panel in the python UI
- added simple texture with sampling and tiling capabilities
- added texture management to scene manager
- added image creation to scene manager
- hooked up background texture (now in root node)
- split root node out to its own file



Revision 100 - Directory Listing
Modified Thu Dec 29 21:33:35 2011 UTC (7 years, 1 month ago) by jacoblundstrom
- changed test executable to deal with me mis-typing scene script names


Revision 99 - Directory Listing
Modified Thu Dec 29 21:23:47 2011 UTC (7 years, 1 month ago) by jacoblundstrom
- fixed silly error in comments of image files
- fixed bug in Targa and RAW loaders (GIMP saved a Targa with 32 bit data and it all blew up!)
- NOTE: bug fix still only deals with 24 and 32 bit values since other formats are not yet supported (figure just add them in as they are encountered)



Revision 98 - Directory Listing
Modified Wed Dec 28 07:09:26 2011 UTC (7 years, 1 month ago) by jacoblundstrom
- NOTE: not tested on linux, but should work, guaranteed to blow up on Sparc due to strict alignment requirements (Targa and Bitmap headers are not 4-byte aligned, thus I disabled packing... see comments in code for mitigation in Targa and Bitmap files)
- added image base class with Targa, Bitmap and RAW *sub* classes (all save/load functionality tested and working for what is implemented... need to add support for other pixel formats... NOTE: I tested this with ray tracer renderings, then saving and reloading.  I have not tested it with *outside* image file.)
- all image formats can be saved interchangeably (and easily!)
- changed RAW header from simple width, height to more stuff... nobody seems to be using RAW, so I played with it
- added depth to render target and changed methods appropriately (note: we don't support anything with depth... yet, maybe some cube maps or 3d textures eh?)
- added some flexibility in render target buffer handling (preparations for different buffer formats... should be ready to just swap out the buffer data type with something else)
- added a boat-load of pixel formats (we only support the byte formats right now, but it gives something to play with... and I would like some HDR ray traced images)
- NOTE: image classes are being added for implementing textures (I am thinking that an image is a *raw* static resource... and a texture is a dynamic resource... image buffer can change and map to entire images, or just parts... dunno, just a thought)



Revision 97 - Directory Listing
Modified Mon Dec 26 08:43:16 2011 UTC (7 years, 2 months ago) by jeremyd
Fix rt_engine/obj_parser.cpp:87:38: error: no matching function for call to ‘COBJParser::buildFace(std::basic_string<char>, COBJParser::CFace&)’

std::string::substr returns a std::string, not a std::string&, and you cannot
pass a temporary (such as a return value from a function) as a non-const
reference parameter.  How did VC let that one compile?



Revision 96 - Directory Listing
Modified Sun Dec 25 23:59:59 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- NOTE: not tested on linux
- added simple background color option to ray tracer and python ui (stubbed in ability to use texture in the future)
- fixed some sizing issues of controls on the ray tracer panel



Revision 95 - Directory Listing
Modified Sun Dec 25 22:23:33 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- NOTE: not tested on linux
- changed light into a movable object... now lights are attached to scene nodes (when a scene management structure exists, like a kd tree, lights will be part of the scene graph and cull appropriately)
- added emissive boolean to material... it means that the material will radiate its diffuse color (no shading, reflection, etc...  think of how a light bulb looks when it is on)
- exposed booleans through python UI
- with the combination of the two booleans, you can add geometry to lights to see where they are in the scene... see cornell_box.txt for an example (just add a light and geometry object to the same node and set the booleans appropriately)
- changed default scene ambient to 0.2
- changed default material diffuse to 0.8
- removed unused onCreate methods (mesh, geomobj)



Revision 94 - Directory Listing
Modified Sun Dec 25 09:50:46 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- fixed bug in config dlg... note: if you opened the config dialog while the default value was empty, you will need to manually set the resource path in the dialog... it will be fine after that


Revision 93 - Directory Listing
Modified Sun Dec 25 07:33:28 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- oops!  wasn't supposed to leave getName commented out on the obj parser... be aware though, that the name inside and obj file is unused, thus getName from the obj parser is unused
- while I was at it, fixed a todo comment to ensure the idea is correctly remembered!... basically, a scene object, i.e., mesh can be loaded and never attached to a scene node, thus never having access to the scene manager for creating materials (which a mesh shouldn't be doing anyways... creating materials that is)
- Is santa going to pass by my house?



Revision 92 - Directory Listing
Modified Sun Dec 25 07:13:01 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- NOTE: not tested on linux... yet
- changed diffuse and ambient terms in scripts to be more inline with values I have seen on the interwebs (amb=0.2,0.2,0.2, diff=0.8,0.8,0.8... leaves a little room for really bright stuff)
- added simple mtl parser for obj files that use mtl (nice since mtl is basically what we already have for a material)
- setup mtl file for box.obj
- integrated mtl parser to obj load
- added a base resource path member to scene manager
- set base resource path in test exe
- added base resource path to config dialog in python ui (you don't need to set this unless you want to point to different media... it defaults to ../media  this works for the svn checkout hierarchy)
- stubbed in texture to material object (not used, just holding a file name if present)
- moved creating a mesh from obj from CMesh to CSceneManager
- fixed create mesh from obj... was missing setting vertex normals and texture coordinates



Revision 91 - Directory Listing
Modified Sun Dec 25 05:44:21 2011 UTC (7 years, 2 months ago) by jeremyd
fix unexpected token after #endif


Revision 90 - Directory Listing
Modified Sun Dec 25 01:01:49 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- NOTE: not tested on linux... yet
- tweaked mesh format in script file to have different buffers for data rather than interlaced data (more like obj format)
- removed mesh format and stride... for now, not going to implement interlaced data for meshes
- added simple wavefront obj parser
- added simple triangle in obj format to media
- changed obj box to have three indices per poly/face (this is due to mesh only supporting triangles right now)
- added simple buffer template (doesn't seem to hinder performance under release builds)
- changed raw buffers in mesh, surface and polygon to use buffer template
- added mesh creation from obj file
- all data is now in mesh, surface and polygon just have indices to the data
- added a delimiter parameter to all toString/fromString methods (vector, bounds and quaternion)
- NOTE: obj rendering is working, but mesh rendering as a whole is buggy... it appears as if there is a transformation bug as all polys look billboarded to the camera



Revision 89 - Directory Listing
Modified Fri Dec 23 20:38:52 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- added attached scene object name to object panel in UI


Revision 88 - Directory Listing
Modified Mon Dec 19 01:42:19 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- added normal out param to geometry intersection method (saves polygon having to recalculate barycentric coords just to find a normal... doesn't speed things up much yet since polys are not used much... and have some funky rendering issues at the moment!)
- added an intersection context object that gathers data from the intersection (not passed all the way through to things like primitives, but it might be worth doing that)
- commented an idea in ray tracer that should greatly speed up anti-alias rendering



Revision 87 - Directory Listing
Modified Sun Dec 18 03:30:05 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- remove simple border style from static label so windows will not have double border (gtx won't draw simple border on static label


Revision 86 - Directory Listing
Modified Sun Dec 18 03:08:37 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- fixed section headers for gtx rendering... seems gtx doesn't want a background color on static labels


Revision 85 - Directory Listing
Modified Sun Dec 18 02:05:29 2011 UTC (7 years, 2 months ago) by jacoblundstrom
- After trying all day to split this commit into multiple pieces, I am giving up and committing everything at once.  Every time I would split it, I would have to drag in more and more changes.
- NOTE: This commit breaks OpenCL rendering.  It is disabled in the pre-compiled header of the engine.  OpenCL will require changes to the serialized structures and kernels to be fixed.  It shouldn't be too difficult, but many changes have been made.
- NOTE: Compiles and runs fine on linux (small UI coloring issues for section headers on linux but doesn't affect functionality)
- NOTE: I did not update vs2005 or vs2008, only vs2010 is updated
- completely changed scene script format and bumped version... scene now has a ray tracer section and a scene hierarchy (which must be defined at the end... probably split out the hierarchy into a different file in the future)
- updated all committed scene files to work with new format
- updated entire python ui to deal with engine changes (too much to list, but self-explanatory when using the UI... NOTE: when testing on linux, wxPython does not center my section headings, draw a simple border, or color the section heading labels foreground and background colors... windows has no problem here)
- fixed many bugs in load-reload code of UI while refactoring... everything basically works as expected, but has not been completely bounds tested
- changed script parser to deal with child sections and pass back section names
- updated scene manager to deal with script parser changes (includes updating all createXXX methods to handle parameter changes)
- updated all resources to deal with new creation from scene manager
- added simple command line interface to windows exe
- changed all geometry to test for intersection from their local position... the movable object the geometry is attached to will transform the ray before performing operations
- took graph node, scene node and moveable object from air hockey... gives full scene graph hierarchy with separation between objects in the scene and nodes that manage them
- updated scene manager to deal with graph node and scene node, but it is not the air hockey scene manager... the ray tracer has different requirements (but will be very close when complete)
- removed scene... scene manager manages a root node now that is the scene rather than manage a collection of scenes... only one scene is really necessary
- added a ray tracer object... encompasses the ray tracing algorithm (when CScene used to do)
- removed entity... movable object has taken its place... there are two derived movable objects... a geometry object which encapsulates a geometric primitive and a mesh which encapsulates surfaces and polygons that make up the mesh
- mesh, surface and polygon have been added
- mesh => collection of surfaces, bounds and a vertex buffer
- surface => collection of polygons, material and bounds
- polygon => collection of indices, face normal and vertex normal
- mesh renders fairly well, but there are small gaps at polygon shared edges... possibly floating point precision loss or the AABB bounds check during intersection... I think the AABB at intersection testing also causes occational clipping of the polygons
- NOTE: mesh only supports triangular data at the moment... the generic ray-poly test only works for polys in certain locations... needs some fixing (I think it is in the poly 2D projection... the point-in-poly algorithm seems ok)
- fixed up camera to render from any position and to look at a given position :D  (oh, just remembered... I added it to the ortho camera as well, but did not test ortho rendering!!!)
- added vector and quaternion from air hockey... NOTE: when compiling vector on GCC, the reflect method could not resolve the normal template type during the * operator.  I casted it to T to fix the problem, but felt it should not have been necessary due to air hockey and vector compiling just fine on GCC.
- removed ortho ref image (no longer valid and when random scattering is implemented, it won't match unless random seeding is identical)
- added resize capability to render target (allows for better python UI rendering/panel size integration)
- updated python wrapper bindings
- added matrix from air hockey, but is unused at the moment



Revision 84 - Directory Listing
Modified Fri Nov 25 07:22:41 2011 UTC (7 years, 3 months ago) by jacoblundstrom
- this is a large commit... larger than I intended (changed some stuff that cascaded into a bunch of changes)
- The basic change is creating a render target object.  The render target is a buffer for a camera to render to.  Each camera has a render target.  When rendering a scene, the scene and camera are passed in, then the scene is rendered into the camera's render target (viewport if you wish).  Allows for multiple cameras to render the scene into multiple buffers for the client to manipulate as they see fit.
- moved some parameters from scene and camera to render target
- python ui displays render target properties as camera properties
- removed image.width/height from scene files and moved it to camera (NOTE: I just updated all committed scene scripts rather than bump the script version... so if you have some uncommitted test scripts... sorry)
- added depth of field enable/disable to ui and camera
- put the ui render panel in a scroll window (not quite right yet... pixel vs screen sizes I think... didn't bother looking into it yet)
- removed flipX/Y properties... render target always has its origin at top-left
- create opencl device during python ui launch so you don't have to visit the about menu anymore (selects the first device in the list to use for rendering)
- added ui log message for exposure/auto-exposure enable/disable
- added render error event in python
- fixed bug during setting resource names (always checking scene name rather than appropriate resource container)
- added face noraml caching to polygon (don't think I ever tested this...)
- looks like some tab/space changes happened in camera.cpp
- NOTE: all of this needs more testing... rendered cornell_box.txt and scene.txt for both software and opencl... identical renders (software: 0.95 sec.  opencl after initial kernel compile: 0.07 sec.)... seems like everything works (tested changing a few settings as well)... tried poly_test.txt and opencl render is strange... software is fine... IIRC opencl poly was never implemented/finished? (didn't investigate)



Revision 83 - Directory Listing
Modified Tue Nov 22 06:57:03 2011 UTC (7 years, 3 months ago) by jacoblundstrom
- fixed some issues when compiling without open cl defined (in engine and python ui)
- added additional log output during rendering specifying whether or not open cl is being invoked



Revision 82 - Directory Listing
Modified Tue Nov 22 06:14:04 2011 UTC (7 years, 3 months ago) by jacoblundstrom
- all notebook windows are now scroll windows (vertical scroll only... the splitter is set to a minimum size larger than the minimum width of a notebook panel)
- added add, remove, edit buttons to all notebook panels (not actually hooked up, but they will be to allow easy adding of test objects, etc... if we had a simple real-time renderer, it could serve as a scene editor... then feed the ray tracer for final static-rendering)
- added config file/registry for a default scene (other things could be added easily)... I used wx.Config which writes to the user registry hive on win32 or a file to the home directory on *nix platforms.... I like this due to not having to remember to specify anything at the cmd line... NOTE: cmd line processing takes precedence over config stuff
- added two-sided property to entity... not sure if I like this anymore



Revision 81 - Directory Listing
Modified Tue Nov 22 05:46:09 2011 UTC (7 years, 3 months ago) by jacoblundstrom
- added vs2010 files
- fixed small issue in entity loading (should be using stored variable)



Revision 80 - Directory Listing
Modified Wed Sep 1 05:15:35 2010 UTC (8 years, 5 months ago) by jeremyd
NVidia driver version 256.x is now being pushed out through Windows Update, and
has been unmasked in gentoo, so I guess it's about time to commit the
workaround to get the OpenCL code working against this driver version.

Converted __constant buffers to __global, because NVidia 256.x drivers are not
getting any data in these __constant buffers (it's all zero).  This doesn't
happen with simple test programs with __constant buffers, so I don't know
exactly what's going on.

This hurts performance a little, but it had to happen eventually anyway,
because those buffers' sizes varied with the complexity of the scene, so a
sufficiently complex scene could have exhausted the card's constant memory.



Revision 79 - Directory Listing
Modified Wed Aug 18 05:22:08 2010 UTC (8 years, 6 months ago) by jeremyd
update the boost user-config.jam sample with what is required to cross-compile for 64-bit python from 32-bit windows


Revision 78 - Directory Listing
Modified Sun Aug 1 18:08:07 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- added active state to scene node (and exposed through python)... not used yet.. hooked up to check box in ui... figured it would be helpful to be able to toggle visible state of objects for debugging
- added getting aabb normal algorithm to box... doesn't work quite right yet... see comments in code



Revision 77 - Directory Listing
Modified Sun Aug 1 06:02:50 2010 UTC (8 years, 6 months ago) by jeremyd
Fix UI crash on wxGTK: don't mess with the UI from any thread other than the one-and-only UI thread.


Revision 76 - Directory Listing
Modified Sat Jul 31 23:17:17 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- tweaked some params of poly test
- added ability to move planes through python ui (hooked up position listener in plane)
- added optimization to polygon intersect... it checks AABB first, then performs vertex checking... shaved .3 seconds off per render with only 2 polygons in the scene!
- removed width, height and depth from box primitive.. using bounds from node
- added some divide operations to vector
- NOTE: box has fake normal for seeing materials
- NOTE: box causes strange shadows (there is one on the ceiling of the cornell box)



Revision 75 - Directory Listing
Modified Sat Jul 31 18:42:02 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- set progress to 1000 on render finish to stop windows Knight-Rider progress bar animation



Revision 74 - Directory Listing
Modified Sat Jul 31 18:17:45 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- added radius squared to opencl serialized struct for optimization (didn't notice any change in render times, but saves a multiplication)
- changed opencl kernel sphere intersection to use optimization



Revision 73 - Directory Listing
Modified Sat Jul 31 18:05:32 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- added progress bar to status bar for c++ rendering progress
- added box primitive (untested... just implemented)



Revision 72 - Directory Listing
Modified Sat Jul 31 05:21:32 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- fixed issue in inequality operator for vectors preventing bounds from changing (you can now change sphere sizes in python ui... note only x is used for sphere radius from bounds)



Revision 71 - Directory Listing
Modified Sat Jul 31 04:46:43 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- added rudimentary locking to rendering so you can now hold down camera movement keys for interactive ray-tracing... (note: cam only moves forward/backward)
- made sphere scene node listener to hook up radius changing when bounds change... work-in-progress (untested)



Revision 70 - Directory Listing
Modified Sat Jul 31 03:55:41 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- oops!  polygon was not supposed to be in cornell box scene file



Revision 69 - Directory Listing
Modified Sat Jul 31 03:53:05 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- fixed vector setting from python... now all positions, colors, etc... can be set from python UI
- put poly test in cornell box to see reflectance and shadows
- added key down handler to render panel... you move the camera with w, a, s, d... with opencl you can get almost real-time (lower depth and complexity and it would be)...  however, I did not add any *waiting for a frame to render*, so if you do hold down a key, expect an error from the OnRenderFinished callback



Revision 68 - Directory Listing
Modified Fri Jul 30 06:25:44 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- fixed issue where python would crash if scene file name was not found



Revision 67 - Directory Listing
Modified Fri Jul 30 05:28:16 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- better test script for poly... allows reflection and shadow to be seen



Revision 66 - Directory Listing
Modified Fri Jul 30 05:16:12 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- fixed issue in polygon intersection where poly plane would occlude the entire scene (distance should only be modified if intersection takes place)
- set bounds for polygon scene node
- normalized polygon normal upon return
- added four vertex polygon to test
- changed polygon loading in entity to take n vertices (must be numbered in script... boo)



Revision 65 - Directory Listing
Modified Fri Jul 30 04:23:04 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- oops!  fixed poly-ray intersection... had some copy-paste errors



Revision 64 - Directory Listing
Modified Thu Jul 29 07:07:58 2010 UTC (8 years, 6 months ago) by jeremyd
add opencl rendering to CSceneManager.  Right now, it only supports RAW format, but other formats may be added later (especially once I play around with the image2d stuff, which supports different image formats like RGBA and BGRA).  This will probably break the non-USING_OPENCL case, so we may want to remove the two other variants of renderScene and combine them all under the one that takes an opencl device


Revision 63 - Directory Listing
Modified Thu Jul 29 06:37:14 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- added opencl utils to vc project
- implemented polygon (very limited tested, but renders... probably some degenerate cases like *edge on* ray tests)



Revision 62 - Directory Listing
Modified Thu Jul 29 05:09:33 2010 UTC (8 years, 6 months ago) by jeremyd
fix off-by-one error in the coordinates in opencl, when flipped


Revision 61 - Directory Listing
Modified Thu Jul 29 04:51:36 2010 UTC (8 years, 6 months ago) by jeremyd
factor out opencl raii wrappers into their own file, instead of being inline in the python_wrapper test function.  First step in integrating opencl render into scene_manager.  TODO: add opencl_utils to vcproj


Revision 60 - Directory Listing
Modified Thu Jul 29 03:23:49 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- exposed geometry through entity and removed duplicate interface (except for material accessors... requires python editor change)
- added scene node to geometry base
- removed position, orientation (and bounds) from geometry... they are scene properties, so the scene node should manage those
- added material to geometry base class... don't like it here since it break the *math object* idiom, but we need a material reference on a per-primitive basis
- NOTE: changed opencl serialized geometry function



Revision 59 - Directory Listing
Modified Thu Jul 29 02:31:54 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- changed all colors to CVector4
- NOTE: while alpha channel exists, it is not used yet... in other words, openCL packing things like specular power in the alpha channel is still ok
- added a bunch of operators to CVector4... ahh where is the speedy val_array when you need it
- added cross product to CVector4 which ignores the w factor... just a convenience... wedge product doesn't seem geometrically significant, so I didn't add it
- added CVector2 and CVector4 to python exports (NOTE: python uses split and join on strings... it didn't seem affected by the change :)... granted, setting vectors from python doesn't work right now



Revision 58 - Directory Listing
Modified Wed Jul 28 07:02:25 2010 UTC (8 years, 6 months ago) by jeremyd
remove useless virtual destructor from CRay.  It could only hurt performance, and it is the only reason this class needed a vtable at all.


Revision 57 - Directory Listing
Modified Wed Jul 28 06:58:10 2010 UTC (8 years, 6 months ago) by jeremyd
integrate r55 sphere change (protecting against sqrt(0)) into opencl.  Fix my last fix so that it works on the nvidia implementation as well as ATI's


Revision 56 - Directory Listing
Modified Wed Jul 28 06:50:33 2010 UTC (8 years, 6 months ago) by jeremyd
fix order of operations issue that caused what appeared to be inaccuracy in normalize, which in turn caused getting the sphere normal to go wonky, which caused the odd highlights.  Whew\!


Revision 55 - Directory Listing
Modified Wed Jul 28 01:34:24 2010 UTC (8 years, 6 months ago) by jacoblundstrom
- upon suggestion, fixed issue in sphere intersection where sqrt(0) could be possible (guess I got lucky this time...)... no detectable change in render appearance, plus it is safer!



Revision 54 - Directory Listing
Modified Tue Jul 27 06:41:48 2010 UTC (8 years, 7 months ago) by jeremyd
HACK: if the image dimensions and kernel work group size allow, set local dimensions to 8x16.  It really should try to maximize based on factors of the width and height, and limiting the product of the two to the work group size, but for now my 8800 and laptop are the limiting factor devices (at 128, the cpu impl is at 1024), and this is perfect for them


Revision 53 - Directory Listing
Modified Tue Jul 27 06:39:29 2010 UTC (8 years, 7 months ago) by jeremyd
found and fixed a couple of differences from C++ code (no change in output, though).  I think the sphere one may have been right in the CL, and wrong in the C++, though


Revision 52 - Directory Listing
Modified Tue Jul 27 06:35:31 2010 UTC (8 years, 7 months ago) by jeremyd
adjust scene size so width and height are both divisible by 16 (yay for powers of two!)


Revision 51 - Directory Listing
Modified Tue Jul 27 06:35:03 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- added toolbar button for open cl rendering (just had to do it...)



Revision 50 - Directory Listing
Modified Tue Jul 27 05:50:59 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- added ok, cancel to open cl dialog... sets device for rendering
- you can now render both open cl and non open cl just by selecting render type under view menu



Revision 49 - Directory Listing
Modified Tue Jul 27 05:00:56 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- fixed all vector3 setting from python
- NOTE: When setting value from CVector3, python does call into c++ and sets vector, but the value is lost... seems like life time issue



Revision 48 - Directory Listing
Modified Tue Jul 27 04:13:45 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- added render open cl menu item to view menu (value is passed into pyton render thread, but only printed to console...)
- fixed label on entity panel
- NOTE: the toolbar render button is non-open cl



Revision 47 - Directory Listing
Modified Tue Jul 27 03:52:55 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- fixed issue where only scene.txt would show up for loading from dialog
- NOTE: Don't load up two different scenes yet... bad joojoo (it does render... :)



Revision 46 - Directory Listing
Modified Tue Jul 27 03:46:56 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- fix camera focus in cornell box
- lower complexity in cornell box to minimum (1)



Revision 45 - Directory Listing
Modified Tue Jul 27 03:33:27 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- added simple cornell box... helps for seeing defects in rendering (refractions, reflections, lighting, etc...)



Revision 44 - Directory Listing
Modified Tue Jul 27 03:12:25 2010 UTC (8 years, 7 months ago) by jeremyd
implement image flip in opencl


Revision 43 - Directory Listing
Modified Tue Jul 27 03:11:41 2010 UTC (8 years, 7 months ago) by jeremyd
reorder objects in makefile, so python_wrapper gets built first.  This should maximize parallel makes, since that file takes the longest to build, so all the other files should be able to build in parallel with that one


Revision 42 - Directory Listing
Modified Tue Jul 27 02:30:10 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- added media directory with test box.obj and moved scene script into this dir
- changed scene script to flip x and have 2 rays shot for complexity to keep things speedy (haha... turning your world up-side-down)
- fixed issue in render_pnl.py where loading a scene from the command line would crash (make sure back buffer is valid before writing to it!)
- moved render timing into ray_tracer (the main frame) and out of render thread
- added base resource path to python scene manager (planning on using this when meshes are introduced)
- added handling of a single cmd line arg... it uses the base resource path (which is a relative path to the added media directory), so you can just type the scene script name if it lives in the media directory, e.g., ray_tracer.py scene.txt
- fixed issue in scene and scene manager c++ that did not allow for refreshing the currently loaded scene by... tada! reloading it



Revision 41 - Directory Listing
Modified Mon Jul 26 22:53:05 2010 UTC (8 years, 7 months ago) by jeremyd
Fix plane intersection test (only check when dist < 0, for one-sided planes).  Fix copy/paste-o in opencl plane intersection (should have used ray origin, was using plane normal, in dot product


Revision 40 - Directory Listing
Modified Mon Jul 26 07:34:11 2010 UTC (8 years, 7 months ago) by jeremyd
add function call to get maximum work group size for our kernel (currently just output to cout for debugging purposes), and a comment about the algorithm that will be needed to determine a good local size given the width, height, and work_group_size.


Revision 39 - Directory Listing
Modified Mon Jul 26 04:56:12 2010 UTC (8 years, 7 months ago) by jeremyd
oops, didn't mean to commit this file


Revision 38 - Directory Listing
Modified Sun Jul 25 21:12:53 2010 UTC (8 years, 7 months ago) by jeremyd
serialize and use scene parameters (ambient, complexity, max depth, exposure).  Also serialized gamma, and flip x/y, but those are not used yet.  TODO: if we don't support flip x/y in opencl (sounds reasonable), then we may be able to use special values (0, nan, inf) instead of flags for the exposure/gamma flags and get rid of the flags field


Revision 37 - Directory Listing
Modified Sun Jul 25 06:56:34 2010 UTC (8 years, 7 months ago) by jeremyd
add boost filesystem/system libs to vc 2008 project


Revision 36 - Directory Listing
Modified Sun Jul 25 06:05:27 2010 UTC (8 years, 7 months ago) by jeremyd
change detection of 64-bit python on Windows to something a little less hackish (and it even works on python2.5!)


Revision 35 - Directory Listing
Modified Sun Jul 25 05:14:23 2010 UTC (8 years, 7 months ago) by jeremyd
put lights and camera in __global memory instead of __constant memory.  By experimental results, changing each type from __constant to __global and making 4 runs on my 8800GT, determined that making lights and camera __global decreased runtime, while making materials and entities/geometries __global increased runtime.  Go figure.  Hopefully this will fix my 'out of resources' error on my laptop too


Revision 34 - Directory Listing
Modified Sat Jul 24 20:36:42 2010 UTC (8 years, 7 months ago) by jeremyd
comment out debugging code


Revision 33 - Directory Listing
Modified Sat Jul 24 20:35:53 2010 UTC (8 years, 7 months ago) by jeremyd
Fixed a few things, found while stepping through pixel 425,125 in two debuggers, one in each implementation:

* yet another switch decided to break in ATI's CPU compiler in -g mode :(

* turns out the block I thought Jake had told me was broken and not used is in fact used, so I had to implement it after all.

* params were backwards on dot() function (I think dot product is commutative, so it shouldn't have mattered, but it was a difference).

* The REAL problem: the logic on determining whether a light ray was occluded by another object was backwards (so only occluded rays contributed to the end color)

* added a hard-coded, hackey exposure filter

* TODO: marshal scene parameters like maxdepth, exposure, etc, instead of hardcoding them in the opencl



Revision 32 - Directory Listing
Modified Sat Jul 24 20:30:45 2010 UTC (8 years, 7 months ago) by jeremyd
turn scene flipX off, it was interfering with my debugging (and making it harder to compare images between OpenCL and C++)


Revision 31 - Directory Listing
Modified Sat Jul 24 06:59:34 2010 UTC (8 years, 7 months ago) by jeremyd
add a simple timing mechanism around the render.  It's probably nowhere near accurate, but it gives a feeling for how long it takes


Revision 30 - Directory Listing
Modified Sat Jul 24 06:37:27 2010 UTC (8 years, 7 months ago) by jeremyd
add in serialization of lights.  Add in shaders, and implement material_calculate.  Need some debugging, still doesn't look right.  Also, I get an 'out of resources' error on my laptop running GPU (going to test on desktop next)


Revision 29 - Directory Listing
Modified Fri Jul 23 06:46:37 2010 UTC (8 years, 7 months ago) by jeremyd
add usage of materials (currently just applyBump and preCalculate (minus the transmittance stuff) are implemented).  Added Park-Miller PRNG ('uniform random deviants').  TODO: turn on the lights\!


Revision 28 - Directory Listing
Modified Thu Jul 22 07:01:58 2010 UTC (8 years, 7 months ago) by jeremyd
add seralizing of materials to opencl (unused so far, need to build a mapping of material name to index in array, and associate that index with each geometry).  Factor out some code from the monolithic .cl file (note the pain with which we have to deal with include paths for opencl, and watch out for paths with spaces in their names).  TODO: we really really REALLY need to do something about factoring out that test function in python_wrappers.h\!\!\!


Revision 27 - Directory Listing
Modified Wed Jul 21 07:11:55 2010 UTC (8 years, 7 months ago) by jeremyd
add initial opencl port of perlin.  Untested (nothing calls it yet), but it compiles for both AMD (CPU impl) and NVidia GPU


Revision 26 - Directory Listing
Modified Wed Jul 21 05:37:22 2010 UTC (8 years, 7 months ago) by jeremyd
plug in more of the implementation of castRay.  Most of it is ifdef'd out, but it still makes a pretty cool picture.  TODO need to marshal material info to opencl


Revision 25 - Directory Listing
Modified Wed Jul 21 05:30:23 2010 UTC (8 years, 7 months ago) by jeremyd
make the viewRay parameter to CScene::castRay pass-by-value instead of pass-by-reference, since it's modified in that function, but those modifications should NOT be visible in the caller's version.  Also updated exposure value in scene.txt to -1.0 to adjust for the fact that the algorithm is working right now.  Per discussion with Jake today


Revision 24 - Directory Listing
Modified Tue Jul 20 05:59:13 2010 UTC (8 years, 7 months ago) by jeremyd
Add formats BF_RGBA and BF_BGRA to CScene::BufferFormat, and make the 'raw'
format use BF_RGBA.  This allows the C++ and OpenCL implementations to generate
the same format.



Revision 23 - Directory Listing
Modified Mon Jul 19 06:01:39 2010 UTC (8 years, 7 months ago) by jeremyd
add a user-config.jam file which will override the detected python path for 64-bit builds.  This allows the dll version of boost_python to be built for x64.  Reference this file from the bjam command line (during the normal boost building procedure) with --user-config=x:\path\to\py64-user-config.jam.  Note that this assumes you're using a 32-bit build of bjam (otherwise it'd probably detect the 64-bit python and break the 32-bit build).  Note that the path to the 64-bit python install is hard-coded: bjam has a W32_GETREG builtin, but it isn't too bright in the face of wow64 (there are workarounds for Wow6432node when looking for msvc/python paths, but there's no way to query 64-bit registry from 32-bit process (it'd need to pass the KEY_WOW64_64KEY REGSAM to RegOpenKeyEx to do that.  Anyone care to send boost a patch?)


Revision 22 - Directory Listing
Modified Mon Jul 19 01:39:58 2010 UTC (8 years, 7 months ago) by jeremyd
added x64 configurations.  Switched boost python lib to static version (static boost_python, not static libc), since for some reason I haven't investigated yet, the dll version is not building for x64.  This doesn't seem to hurt anything (so far), and has the added advantage of not having to keep the debug/release folders in svn


Revision 21 - Directory Listing
Modified Mon Jul 19 00:58:10 2010 UTC (8 years, 7 months ago) by jeremyd
add support for x64 python loading x64 dll on Windows


Revision 20 - Directory Listing
Modified Sun Jul 18 21:22:30 2010 UTC (8 years, 7 months ago) by jeremyd
refactor opencl kernel entry point, so that all the work is done in an _internal function, which allows for support of making a new __kernel entry point that writes to an image2d_t instead of a uchar4*.  This new entry point is untested, but compiles on NVidia (the only device I have that has image support)


Revision 19 - Directory Listing
Modified Sun Jul 18 20:47:07 2010 UTC (8 years, 7 months ago) by jeremyd
remove vc2005 projects from version control, and add a perl script to downconvert the 2008 projects to 2005.  Add a *.pyc ignore to ray_tracer_py


Revision 18 - Directory Listing
Modified Sun Jul 18 07:00:59 2010 UTC (8 years, 7 months ago) by jeremyd
adjust hard-coded path to opencl source file, to work out better from the python app's directory


Revision 17 - Directory Listing
Modified Sun Jul 18 06:50:30 2010 UTC (8 years, 7 months ago) by jeremyd
deal with malloc that is only guaranteed to return 8-byte-aligned memory (stupid 32-bit linux)


Revision 16 - Directory Listing
Modified Sun Jul 18 06:44:13 2010 UTC (8 years, 7 months ago) by jeremyd
hahaha.  My odd NVidia result was due to uninitialized memory\!


Revision 15 - Directory Listing
Modified Sun Jul 18 04:08:51 2010 UTC (8 years, 7 months ago) by jeremyd
add intial simplified OpenCL implementation, which only does ray intersections per pixel of output, no bounces, no materials.  This results in a simple black/white mask of the image.  Also added a simple hack function to make it go.  Note there is still a strange issue going on when run against the NVidia device in my laptop (the AMD CPU implementation works fine)


Revision 14 - Directory Listing
Modified Sun Jul 18 01:13:35 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- added a bunch of opencl codes to string methods in open cl dialog (output makes more sense now!)



Revision 13 - Directory Listing
Modified Sat Jul 17 21:30:23 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- added render toolbar button and icon
- fixed issue where pressing render with no scene loaded would cause python error
- fixed setup.py to generate resources
- NOTE: when attempting to use img2py, it would not embed pngs in the resource file.  I found this forum post about the issue: http://osdir.com/ml/wxpython-users/2009-10/msg00116.html
- According to that forum, there is a bug in wxpython and is fixed in the trunk: http://svn.wxwidgets.org/svn/wx/wxPython/trunk/wx/tools/
- There is only one notable change in there, and yes, it does fix embedding pngs.
- Look at line 120 of \Python\Lib\site-packages\wx-2.8-msw-unicode\wx\img2py.py
- original line is: file(newname, "wb").write(file(fileName).read())
- fixed line is: file(newname, "wb").write(file(fileName, "rb").read())



Revision 12 - Directory Listing
Modified Sat Jul 17 19:55:29 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- added ifdef USING_OPENCL to error code to str function
- removed BOOST_PYTHON_STATIC_LIB define since it was causing an unresolved external link error on the self_ns boost python struct in vs2008



Revision 11 - Directory Listing
Modified Sat Jul 17 19:25:44 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- all open cl properties are now displayed on open cl dialog
- using list for dev props since there are way too many to fit into text controls on a dialog
- changed size of main python iu
- NOTE: using python dict for dev props, so list control is unordered... thought about using treelistctrl, but I recall xrced and that control are not yet fully integrated... keep having to remember to paste in a block of code in the xrc file



Revision 10 - Directory Listing
Modified Sat Jul 17 05:42:41 2010 UTC (8 years, 7 months ago) by jeremyd
have some const qualifiers, stupid creeping constness


Revision 9 - Directory Listing
Modified Sat Jul 17 04:39:37 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- added error code to msg thrown from check_opencl_err


Revision 8 - Directory Listing
Modified Sat Jul 17 04:24:04 2010 UTC (8 years, 7 months ago) by jacoblundstrom
- added a bunch of ignores
- added os.name nt switch to ray_tracer.py
- added open cl properties dialog stub (just a stub... nothing layed out or functional)
- added open cl error code to string function (taken from ati open cl forums... my ego could handle being told I suck anymore! :)
- added check_opencl_err function which throws a runtime_error if code is not CL_SUCCESS
- added check_opencl_err call to opencl calls checking return code
- NOTE: removed two, what appeared to be, dangling checks of error codes in the open cl stuff.
- added some casts to quiet down compiler warnings
- updated vs2008 project



Revision 7 - Directory Listing
Modified Fri Jul 16 07:13:10 2010 UTC (8 years, 7 months ago) by jeremyd
add opencl serialization of the camera.  add python bindings for opencl platforms and devices (based loosely on pyopencl), so we can have a UI to pick which device you want to use.  Such a UI is left as an exercise for the reader ;).  Change unix makefile to link with OpenCL.  Windows project(s) will need the same


Revision 6 - Directory Listing
Modified Tue Jul 13 06:40:01 2010 UTC (8 years, 7 months ago) by jeremyd
add initial implementation of serializing the scene for opencl.


Revision 5 - Directory Listing
Modified Mon Jul 12 06:53:01 2010 UTC (8 years, 7 months ago) by jeremyd
adjust isZero, gtZero and ltZero to use the std::numeric_limits<real_t>::epsilon() value instead of hardcoded 1e-08.  This turns out to work well for things that should return 0 (such as cos(HALF_PI)) when real_t is float, double, or long double (at least on my machine)


Revision 4 - Directory Listing
Modified Sun Jul 11 06:29:05 2010 UTC (8 years, 7 months ago) by jeremyd
whilst trying to familiarize myself with the code, came across a todo that I knew the answer to, so went ahead and to-did it.


Revision 3 - Directory Listing
Modified Sat Jul 10 20:26:25 2010 UTC (8 years, 7 months ago) by jeremyd
add support for passing in a python file-like object to renderScene, in addition to the version that takes a file name.  Wrap a python file-like object in a boost iostreams device, so we can pass it to the existing functions that want std::ostream&


Revision 2 - Directory Listing
Modified Fri Jul 9 07:17:06 2010 UTC (8 years, 7 months ago) by jeremyd
apply my patch to get building/running on linux


Revision 1 - Directory Listing
Added Fri Jul 9 07:15:45 2010 UTC (8 years, 7 months ago) by jeremyd
import code emailed by Jake on 7/8/2010