MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0024864Open CASCADE[OCCT] OCCT:Visualizationpublic2014-04-21 17:472014-11-11 12:58
Reporterdbp 
Assigned Toapn 
PrioritynormalSeverityfeature 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 6.8.0Fixed in Version[OCCT] 6.8.0 
Summary0024864: Visualization - Implementing refractions in ray-tracing
DescriptionFor transparent objects implemented ray refraction according to refraction index.
Refraction index passed to raytrace shader. Transparent materials have been modified to look better with refractions.
Additional information
and documentation updates
Optical refractions according to specified refraction index have been implemented for transparent objects (in OCCT ray-tracing core). Transparent materials have been modified to look better with refractions ('water', 'glass' and 'diamond').
TagsNo tags attached.
Test case numberNot needed
Attached Filespng file icon refraction.png (18,855 bytes) 2014-06-30 08:15

- Relationships
related to 0024855closedapn Open CASCADE Revision of parameters of standard materials 
related to 0023387closedbugmaster Community Visualization - transparency of specified material is ignored within AIS_Shape::SetMaterial() 
related to 0024887closedapn Open CASCADE Visualization - revise and extend Raytracing controls 

-  Notes
(0029004)
dbp (developer)
2014-04-22 10:29

Dear duv,

please use this base fucntion:

// =======================================================================
// function : Refract
// purpose :
// =======================================================================
vec3 Refract (in vec3 theInput, in vec3 theNormal)
{
  float aNdotI = dot (theInput, theNormal);
  
  float anIndex = aNdotI < 0.0
                ? 1.0 / 1.5
                : 1.5 / 1.0;
                
  float aSquare = anIndex * anIndex * (1.0 - aNdotI * aNdotI);
  
  if (aSquare > 1.0)
  {
    return reflect (theInput, theNormal);
  }

  vec3 aOut = (aNdotI < 0.0)
    ? anIndex * theInput - (anIndex * aNdotI + sqrt (1.0 - aSquare)) * theNormal
    : anIndex * theInput - (anIndex * aNdotI - sqrt (1.0 - aSquare)) * theNormal;

  return normalize (aOut);
}
(0029300)
duv (developer)
2014-05-13 16:14

Dear kgv,

please review the patch.
(0029311)
kgv (developer)
2014-05-14 08:27
edited on: 2014-05-14 08:27

Dear Danila,

     vec4 aSpecular = vec4 (texelFetch (
       uRaytraceMaterialTexture, MATERIAL_SPEC (aTriIndex.w)));
-    vec2 aOpacity = vec2 (texelFetch (
+    vec4 aOpacity = vec4 (texelFetch (
       uRaytraceMaterialTexture, MATERIAL_TRAN (aTriIndex.w)));

could you please specify what for all these "vec4(texelFetch("? I think vec4 constructor is redundant here.

+      theInverse.z = theRay.Direct.z < 0.0 ? -theInverse.z : theInverse.z;
+      
+      aPoint += aHit.Normal * (dot (aHit.Normal, theRay.Direct) >= 0.f ? uSceneEpsilon : -uSceneEpsilon);


it would be better to use same style across the code (">= 0.0" instead of ">= 0.f")...

(0029312)
duv (developer)
2014-05-14 10:45

Dear kgv,

please review the patch.
(0029370)
kgv (developer)
2014-05-16 14:01

Please test the patch.
(0029469)
apv (tester)
2014-05-22 16:14
edited on: 2014-05-22 16:18

Dear BugMaster,

Branch CR24864 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 6e734e8b572450ed07ae6eb4e838f647b54e877c

Number of compiler warnings:

Linux: 17 (17 on master)
Windows: 0 (0 on master)

products component :
Linux: 11 (11 on master)
Windows: 2 (2 on master)

Regressions/Differences:
Not detected

Testing cases:
Absent

Testing on Linux:
Total MEMORY difference: 355730320 / 357316044
Total CPU difference: 59822.65999999958 / 56363.22999999993

Testing on Windows:
Total MEMORY difference: 379211864 / 379613888
Total CPU difference: 39919.71875 / 35503.203125


- Related Changesets
occt: master dc9ef964
Timestamp: 2014-04-22 12:55:21
Author: duv
Committer: apn
Details ] Diff ]
0024864: Implementing refractions in ray-tracing

Refraction index passed to raytrace shader.
For transparent objects implemented ray refraction according to refraction index.
Transparent materials modified to look better with refractions.
mod - src/Graphic3d/Graphic3d_Group.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_Workspace_Raytrace.cxx Diff ] File ]
mod - src/Shaders/RaytraceBase.fs Diff ] File ]
add - tests/v3d/raytrace/refraction Diff ] File ]

- Issue History
Date Modified Username Field Change
2014-04-21 17:47 dbp New Issue
2014-04-21 17:47 dbp Assigned To => dbp
2014-04-22 10:28 dbp Assigned To dbp => duv
2014-04-22 10:29 dbp Note Added: 0029004
2014-04-22 17:07 duv Status new => assigned
2014-04-23 10:24 kgv Severity minor => feature
2014-04-23 10:24 kgv Product Version 6.8.0 =>
2014-04-23 10:24 kgv Target Version => 6.8.0
2014-04-23 10:24 kgv Summary Implementing refractions in ray-tracing => Visualization - Implementing refractions in ray-tracing
2014-04-25 15:04 san Relationship added related to 0024855
2014-04-25 15:04 san Relationship added related to 0023387
2014-05-13 16:13 duv Description Updated View Revisions
2014-05-13 16:14 duv Note Added: 0029300
2014-05-13 16:14 duv Assigned To duv => kgv
2014-05-13 16:14 duv Status assigned => resolved
2014-05-14 08:27 kgv Note Added: 0029311
2014-05-14 08:27 kgv Assigned To kgv => duv
2014-05-14 08:27 kgv Status resolved => assigned
2014-05-14 08:27 kgv Note Edited: 0029311 View Revisions
2014-05-14 10:45 duv Note Added: 0029312
2014-05-14 10:45 duv Assigned To duv => kgv
2014-05-14 10:45 duv Status assigned => resolved
2014-05-16 14:01 kgv Note Added: 0029370
2014-05-16 14:01 kgv Assigned To kgv => bugmaster
2014-05-16 14:01 kgv Status resolved => reviewed
2014-05-20 10:18 kgv Relationship added related to 0024887
2014-05-21 16:52 apn Assigned To bugmaster => apn
2014-05-22 16:14 apv Note Added: 0029469
2014-05-22 16:15 apv Assigned To apn => bugmaster
2014-05-22 16:15 apv Status reviewed => tested
2014-05-22 16:18 apn Note Edited: 0029469 View Revisions
2014-05-22 16:19 apn Test case number => Not needed
2014-05-23 14:25 apn Changeset attached => occt master dc9ef964
2014-05-23 14:25 apn Assigned To bugmaster => apn
2014-05-23 14:25 apn Status tested => verified
2014-05-23 14:25 apn Resolution open => fixed
2014-06-30 08:15 kgv File Added: refraction.png
2014-09-29 14:17 dbp Description Updated View Revisions
2014-09-29 14:17 dbp Additional Information Updated View Revisions
2014-11-11 12:45 aiv Fixed in Version => 6.8.0
2014-11-11 12:58 aiv Status verified => closed


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker