Revision: 45551
          http://brlcad.svn.sourceforge.net/brlcad/?rev=45551&view=rev
Author:   kunigami
Date:     2011-07-20 12:48:04 +0000 (Wed, 20 Jul 2011)

Log Message:
-----------
moving constant parts out of the loop

Modified Paths:
--------------
    brlcad/trunk/src/liboptical/sh_osl.cpp

Modified: brlcad/trunk/src/liboptical/sh_osl.cpp
===================================================================
--- brlcad/trunk/src/liboptical/sh_osl.cpp      2011-07-20 03:07:39 UTC (rev 
45550)
+++ brlcad/trunk/src/liboptical/sh_osl.cpp      2011-07-20 12:48:04 UTC (rev 
45551)
@@ -542,45 +542,45 @@
     bu_semaphore_release(BU_SEM_SYSCALL);
 
     Color3 acc_color(0.0f);
-    for(int i = 0; i < nsamples; i++){
 
-       /* -----------------------------------
-        * Fill in all necessary information for the OSL renderer
-        * -----------------------------------
-        */
-       RenderInfo info;
+    /* -----------------------------------
+     * Fill in all necessary information for the OSL renderer
+     * -----------------------------------
+     */
+    RenderInfo info;
+    /* Set hit point */
+    VMOVE(info.P, swp->sw_hit.hit_point);
     
-       /* Set hit point */
-       VMOVE(info.P, swp->sw_hit.hit_point);
+    /* Set normal at the poit */
+    VMOVE(info.N, swp->sw_hit.hit_normal);
     
-       /* Set normal at the poit */
-       VMOVE(info.N, swp->sw_hit.hit_normal);
+    /* Set incidence ray direction */
+    VMOVE(info.I, ap->a_ray.r_dir);
     
-       /* Set incidence ray direction */
-       VMOVE(info.I, ap->a_ray.r_dir);
+    /* U-V mapping stuff */
+    info.u = swp->sw_uv.uv_u;
+    info.v = swp->sw_uv.uv_v;
+    VSETALL(info.dPdu, 0.0f);
+    VSETALL(info.dPdv, 0.0f);
     
-       /* U-V mapping stuff */
-       info.u = swp->sw_uv.uv_u;
-       info.v = swp->sw_uv.uv_v;
-       VSETALL(info.dPdu, 0.0f);
-       VSETALL(info.dPdv, 0.0f);
+    /* x and y pixel coordinates */
+    info.screen_x = ap->a_x;
+    info.screen_y = ap->a_y;
     
-       /* x and y pixel coordinates */
-       info.screen_x = ap->a_x;
-       info.screen_y = ap->a_y;
+    info.depth = ap->a_level;
+    info.surfacearea = 1.0f;
     
-       info.depth = ap->a_level;
-       info.surfacearea = 1.0f;
+    info.shader_ref = osl_sp->shader_ref;
 
-       info.shader_ref = osl_sp->shader_ref;
+    /* We assume that the only information that will be written is thread_info,
+       so that oslr->QueryColor is thread safe */
+    info.thread_info = thread_info;
+    
+    for(int i = 0; i < nsamples; i++){
 
-       /* We only perform reflection if application decides to */
+       /* We only perform reflection if application decides to */
        info.doreflection = 0;
 
-       /* We assume that the only information that will be written is 
thread_info,
-          so that oslr->QueryColor is thread safe */
-       info.thread_info = thread_info;
-
        Color3 weight = oslr->QueryColor(&info);
 
        /* Fire another ray */


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to