Skip to content

Commit

Permalink
Updated to Cortex 9.0.0-a10
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Nov 24, 2014
1 parent a73da8d commit 1271d67
Show file tree
Hide file tree
Showing 3,829 changed files with 1,239 additions and 270 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
File renamed without changes.
80 changes: 80 additions & 0 deletions cortex-9.0.0-a6/Changes → cortex-9.0.0-a10/Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
# 9.0.0-a10

#### IECore

- Fixed GIL bug in python Object creation
- Added implementation of tbb_hasher for boost::intrusive_ptr

#### IECoreGL

- Added State::ScopedBinding overload, allowing a binding to be ignored
- Changed IECoreGL::HitRecord::name field from InternedString to GLuint
- Added IECoreGL::Selector::loadName() overload to auto-generates names
- Removed TextureUnits.h
- Added python bindings for CurvesPrimitive
- Added python bindings for smoothing state components
- Added ToGLStateConverter for converting attributes to State objects
- Fixed crash in ShaderStateComponent::addParametersToShaderSetup()

#### Incompatibilities

- Changed IECoreGL::HitRecord members
- Removed IECoreGL/TextureUnits.h

#### Build

- Fixed compilation for GCC 4.2 on OS X

# 9.0.0-a9

#### IECore

- TIFFImageReader now checks if the tif is tagged as coming from tdlmake, and if so, sets the sourceColorSpace from the image description set by tdlmake.

#### IECoreGL

- Switched glsl diffuse and specular functions to match 3delight's properly normalized BRDFS

#### IECoreMaya

- Fixed coordinate system->maya locator converter crash for coordinate system with no transform
- Fixed crash in SceneShape::hasSceneShapeObject for invalid scene

#### IECoreRI

- Automatic instancing now defaults to on

# 9.0.0-a8

#### IECoreMaya

- Stopped IECoreMaya::LiveScene::readObject() returning null pointers.
- Stopped IECoreMaya::LiveScene::readAttribute() returning null pointers.

#### IECoreRI

- Fixed precision issue with computing the projection matrix for dsm depth remapping, which was causing deep holdout problems.
- Fixed bug when editing cameras when dealing with multiple cameras.

# 9.0.0-a7

#### IECore

- Reduced overhead of calling memoryUsage() on SimpleTypedData.
- Added pixelAspectRatio to list of standard camera parameters.
- Added InternedString( const char *, size_t length ) constructor.

#### IECoreRI

- Added pixel aspect ratio support to IECoreRI::Renderer.
- Fixed argument passing for RiProcDynamicLoad.

#### IECoreArnold

- Added pixel aspect ratio support to IECoreArnold::Renderer.

#### IECoreHoudini

- ToHoudiniGeometryConverter marks Pref and rest as non-transforming
- Preventing SceneCache Source from transforming rest/Pref

# 9.0.0-a6

#### IECore
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions cortex-9.0.0-a6/SConstruct → cortex-9.0.0-a10/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ SConsignFile()
ieCoreMajorVersion=9
ieCoreMinorVersion=0
ieCorePatchVersion=0
ieCoreVersionSuffix="a6" # used for alpha/beta releases. Example: "a1", "b2", etc.
ieCoreVersionSuffix="a10" # used for alpha/beta releases. Example: "a1", "b2", etc.

###########################################################################################
# Command line options
Expand Down Expand Up @@ -748,7 +748,6 @@ o.Add(
( "IECore.MeshNormalsOp", "common/primitive/mesh/addNormals" ),
( "IECore.MeshTangentsOp", "common/primitive/mesh/addTangents" ),
( "IECore.MeshMergeOp", "common/primitive/mesh/merge" ),
( "IECore.MeshPrimitiveImplicitSurfaceOp", "common/primitive/mesh/implicitSurface" ),
( "IECore.MeshVertexReorderOp", "common/primitive/mesh/vertexReorder" ),
( "IECore.MeshPrimitiveShrinkWrapOp", "common/primitive/mesh/shrinkWrap" ),
( "IECore.MeshDistortionsOp", "common/primitive/mesh/calculateDistortions" ),
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,21 @@ IECore::ConstDataPtr IECoreArnold::RendererImplementation::getOption( const std:
void IECoreArnold::RendererImplementation::camera( const std::string &name, const IECore::CompoundDataMap &parameters )
{
CameraPtr cortexCamera = new Camera( name, 0, new CompoundData( parameters ) );
cortexCamera->addStandardParameters();

ToArnoldCameraConverterPtr converter = new ToArnoldCameraConverter( cortexCamera );
AtNode *arnoldCamera = converter->convert();
AtNode *options = AiUniverseGetOptions();
AiNodeSetPtr( options, "camera", arnoldCamera );

applyTransformToNode( arnoldCamera );

ConstV2iDataPtr resolution = cortexCamera->parametersData()->member<V2iData>( "resolution" );
AiNodeSetInt( options, "xres", resolution ? resolution->readable().x : 640 );
AiNodeSetInt( options, "yres", resolution ? resolution->readable().y : 480 );
const V2iData *resolution = cortexCamera->parametersData()->member<V2iData>( "resolution" );
AiNodeSetInt( options, "xres", resolution->readable().x );
AiNodeSetInt( options, "yres", resolution->readable().y );

const FloatData *pixelAspectRatio = cortexCamera->parametersData()->member<FloatData>( "pixelAspectRatio" );
AiNodeSetFlt( options, "aspect_ratio", 1.0f / pixelAspectRatio->readable() ); // arnold is y/x, we're x/y
}

void IECoreArnold::RendererImplementation::display( const std::string &name, const std::string &type, const std::string &data, const IECore::CompoundDataMap &parameters )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ AtNode *ToArnoldCameraConverter::doConversion( IECore::ConstObjectPtr from, IECo
// set screen window
const Imath::Box2f &screenWindow = camera->parametersData()->member<Box2fData>( "screenWindow", true )->readable();
const Imath::V2i &resolution = camera->parametersData()->member<V2iData>( "resolution", true )->readable();
float aspect = (float)resolution.x / (float)resolution.y;
const float pixelAspectRatio = camera->parametersData()->member<FloatData>( "pixelAspectRatio", true )->readable();
float aspect = pixelAspectRatio * (float)resolution.x / (float)resolution.y;
AiNodeSetPnt2( result, "screen_window_min", screenWindow.min.x, screenWindow.min.y * aspect );
AiNodeSetPnt2( result, "screen_window_max", screenWindow.max.x, screenWindow.max.y * aspect );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,7 @@ def testExternalProcedural( self ) :
)
)


ass = "".join( file( self.__assFileName ).readlines() )
print ass

self.assertTrue( "procedural" in ass )
self.assertTrue( "min 1 2 3" in ass )
Expand All @@ -722,6 +720,18 @@ def testExternalProcedural( self ) :
self.assertTrue( "intParm 2" in ass )
self.assertTrue( "colorParm 1 2 3" in ass )

def testPixelAspectRatio( self ) :

r = IECoreArnold.Renderer( self.__assFileName )

r.camera( "main", { "resolution" : IECore.V2i( 640, 480 ), "pixelAspectRatio" : 2.0 } )

with IECore.WorldBlock( r ) :
pass

ass = "".join( file( self.__assFileName ).readlines() )
self.assertTrue( "aspect_ratio 0.5" in ass )

def tearDown( self ) :

for f in [
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@
#ifndef IECOREGL_DIFFUSE_H
#define IECOREGL_DIFFUSE_H

#define M_PI 3.1415926535897932384626433832795

vec3 ieDiffuse( vec3 P, vec3 N, vec3 Cl[gl_MaxLights], vec3 L[gl_MaxLights], int nLights )
{
vec3 result = vec3( 0 );
float normalization = 1.0 / M_PI;
for( int i=0 ; i<nLights; i++ )
{
result += Cl[i] * max( 0.0, dot( N, normalize( L[i] ) ) );
result += Cl[i] * normalization * max( 0.0, dot( N, normalize( L[i] ) ) );
}
return result;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2007, Image Engine Design Inc. All rights reserved.
// Copyright (c) 2007-2010, Image Engine Design Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -32,48 +32,44 @@
//
//////////////////////////////////////////////////////////////////////////

#include "IECoreGL/TextureUnits.h"
#ifndef IECOREGL_SPECULAR_H
#define IECOREGL_SPECULAR_H

const std::vector<GLenum> &IECoreGL::textureUnits()
#define M_PI 3.1415926535897932384626433832795

vec3 ieSpecular( vec3 P, vec3 N, vec3 V, float roughness, vec3 lightColors[gl_MaxLights], vec3 lightDirs[gl_MaxLights], int nLights )
{
static std::vector<GLenum> t;
if( !t.size() )
float n = pow( roughness, -3.5 ) - 1;

// Blinn normalization
float normalization = ( n + 2.0 ) / ( 4.0 * M_PI * (2.0 - pow( 2.0, -n * 0.5 ) ) );

// Combine the visibility term from the denominator of the microfacet BRDF with the normalization
normalization /= dot( N, V );

// We use Schlick's approximation to the Smith G masking/shadowing function
float k = 0.2 * roughness * sqrt( 2.0 / M_PI );

// Eye Component of G : The masking term
float G1V = max( 0, dot( N, V ) ) / ( dot( N, V ) * ( 1 - k ) + k );




vec3 result = vec3( 0 );
for( int i=0 ; i<nLights; i++ )
{
t.push_back( GL_TEXTURE0 );
t.push_back( GL_TEXTURE1 );
t.push_back( GL_TEXTURE2 );
t.push_back( GL_TEXTURE3 );
t.push_back( GL_TEXTURE4 );
t.push_back( GL_TEXTURE5 );
t.push_back( GL_TEXTURE6 );
t.push_back( GL_TEXTURE7 );
t.push_back( GL_TEXTURE8 );
t.push_back( GL_TEXTURE9 );
t.push_back( GL_TEXTURE10 );
t.push_back( GL_TEXTURE11 );
t.push_back( GL_TEXTURE12 );
t.push_back( GL_TEXTURE13 );
t.push_back( GL_TEXTURE14 );
t.push_back( GL_TEXTURE15 );
t.push_back( GL_TEXTURE16 );
t.push_back( GL_TEXTURE17 );
t.push_back( GL_TEXTURE18 );
t.push_back( GL_TEXTURE19 );
t.push_back( GL_TEXTURE20 );
t.push_back( GL_TEXTURE21 );
t.push_back( GL_TEXTURE22 );
t.push_back( GL_TEXTURE23 );
t.push_back( GL_TEXTURE24 );
t.push_back( GL_TEXTURE25 );
t.push_back( GL_TEXTURE26 );
t.push_back( GL_TEXTURE27 );
t.push_back( GL_TEXTURE28 );
t.push_back( GL_TEXTURE29 );
t.push_back( GL_TEXTURE30 );
t.push_back( GL_TEXTURE31 );
GLint max = 0;
glGetIntegerv( GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &max );
t.resize( max );
vec3 L = normalize( lightDirs[i] );
vec3 H = normalize( L + V );

// Light Component of G : The shadowing term
float G1L = max( 0, dot( N, L ) ) / ( dot( N, L ) * ( 1 - k ) + k );

// Blinn microfacet distribution
float D = pow( max( 0.0, dot( N, H ) ), n ) * normalization;
result += lightColors[i] * D * G1L * G1V;
}
return t;
return result;
}

#endif // IECOREGL_SPECULAR_H
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
Loading

0 comments on commit 1271d67

Please sign in to comment.