RE: Toon lens broken on softimage 2014?

2014-07-15 Thread John Voltaire Tensuan
Hi,

We also did a quick test on 2014sp and 2015 and it was working as expected. Can 
you provide us with a test scene that shows the problem? Also could you give us 
the exact version of Softimage 2014 that you are using? (Go to Help->About 
Autodesk Softimage and look at the Build Version)

Thanks

From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Stefan Kubicek
Sent: Tuesday, July 15, 2014 6:22 PM
To: David Rivera; softimage@listproc.autodesk.com
Subject: Re: Toon lens broken on softimage 2014?

I did some toon rendering in 2014Sp2 and that worked without problems.



Hi. I create a toon paint and host material, go to my cam. Add a "toon lens". 
Render preview: none, zilch, nada.

Apparently there´s nothing that´s got changed on SI 2014 for the toon lens to 
be broken.
Anyone else experiencing this? or known bug? I´m using SI 2014 hotfix 1.

Regards.

David Rivera
3D Compositor/Animator
LinkedIN
Behance
VFX Reel


--
   
[http://www.keyvis.at/wp-content/gallery/aboutUs/keyvisLogoMail.png]
-
   Stefan Kubicek 
ste...@keyvis.at
-
  Alfred Feierfeilstraße 3
A-2380 Perchtoldsdorf bei Wien
 Phone: +43 (0) 699 12614231
   www.keyvis.at
 This email and its attachments are
confidential and for the recipient only
<>

RE: Real time shaders on OpenGL and DirectX9 - Softimage 2012 a la Modo?

2014-05-28 Thread John Voltaire Tensuan
That OGL workflow has been deprecated and has been replaced by direct 
GLSL/CgFX/HLSL shaders. You can find these shaders under the Realtime category, 
a similar shader with a similar effect with what the turorial is using is 
Realtime->CgFX->metal.
I've also attached a modified version of it that should support alpha blending.

You can find more about this here:
http://download.autodesk.com/global/docs/softimage2012/en_us/userguide/index.html?url=files/rt_cgfx_hlsl.htm,topicNumber=d30e337896


From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of David Rivera
Sent: Thursday, May 29, 2014 1:05 AM
To: Softimage Mailing List
Subject: Real time shaders on OpenGL and DirectX9 - Softimage 2012 a la Modo?

I know...kinda old thread to ask but I have been using Modo for a time now and 
I´d like to have the same immediate feedback
for the material on softimage 2012 viewport. I know it´s kind of retoric, but 
I´ve setup my material as the digital tutors mention here:
Softimage Tutorials > Shading Network Tips and Tricks in Softimage Tutorial > 
Digital-Tutors
But I can´t find some of the inputs (OGL Draw?). I don´t know what shader´s 
properties to use to generate a real time material.

Could someone lend me a hand on this, please?
This is what I have on my rendertree:



[image]

Softimage Tutorials > Shading Network Tips and Tricks 
in...
In this course we will learn various shading network tips and tricks. Each 
video in this course is a self-contained lesson centering on tips and tricks 
that c...

View on 
www.digitaltutors.com

Preview by Yahoo





David Rivera
3D Compositor/Animator
LinkedIN
Behance
VFX Reel
<>

RE: SDK: port groups in custom operators

2014-04-27 Thread John Voltaire Tensuan
My advice is to do the deformation and the push operation on a temporary array 
first for performance reasons, this will reduce the amount of the data copying 
in and out from the mesh which is slow. The only downside is probably the fact 
that you will need to re-calculate the post deformation normals yourself before 
applying the push.


From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Matt Lind
Sent: Saturday, April 26, 2014 9:56 AM
To: Hsiao Ming Chia; softimage@listproc.autodesk.com
Subject: RE: SDK: port groups in custom operators

Is there any advantage to using port groups (other than accounting for 
arbitrary dynamic connections)?

I think it's time the Softimage wiki got integrated into the standard 
documentation that ships with the product.  Since there is no more development, 
there's no point in having information scattered in several places around the 
internet.


Another issue:

I am writing a custom operator (deformer) in C++ which is experiencing an 
update issue.  It takes several inputs, and has a single output.  The deformed 
mesh has both an input and output port with the output port defined first.  I 
can read and write the point positions of the deformed mesh producing desired 
results - except for one detail.

One feature of my deformer is to allow the user to 'push' the points along the 
geometry's normal using a weight map just like the native push deformer.  
However, the nature of my operator requires the point positions be written to 
the output port to update the deformed mesh before I can perform the push 
calculations as I need updated normals to do that.  The problem I am 
experiencing is the 2nd attempt to write the point positions during the 
_Update() callback do not update the point positions.  The weird part is I had 
the double update working for the push in previous versions of my plugin, but 
the geometry updates were one cycle behind.  Fixing the one cycle lag (caused 
by storing primitives in plugin userdata) broke the push map feature.  2nd 
attempt to write to the output port results in nothing happening.

Sohow can I deform a mesh, then perform a push on it after it's been 
deformed?  Do I have to compute the normals myself?


Pseudo code:

//-
Primitive oPrimitive = oCustomOperator.GetInputValue( 
portInputDeformedMesh );
MATH::CVector3Array aPointPositions = 
oPrimitive.GetGeometry().GetPoints().GetPositionArray();

for ( LONG I = 0; I < aPointPositions.GetCount(); i++ )
{
MATH::CVector3 oPointPosition = 
aPointPositions[i];

// deform points math here
...

// record the modified point position
aPointPositions[i] = oPointPosition;
}

// Write results to mesh
Primitive oPrimitive = oCustomOperator.GetOutputTarget();
oPrimitive.GetGeometry().GetPoints().PutPositionArray( aPointPositions );

// good until here

// Get weight map
ClusterProperty oPushNormalMap = oCustomOperator.GetInputValue( 
portInputWeightMap );
CFloatArray aWeightMapValues;

oPushNormalMap.GetValues( aWeightMapValues );

// re-get points and normals in current deformed state
// ( I have also tried using the input object's primitive - same result)
aPointPositions = oPrimitive.GetGeometry().GetPoints().GetPositionArray();
aPointNormals  = oPrimitive.GetGeometry().GetPoints().GetNormalArray();

// do push math
for ( LONG I = 0; I < aPointPositions.GetCount(); i++ )
{
MATH::CVector3 oPointPosition = 
aPointPositions[i];
MATH::Cvector3 oPointNormal = aPointNormals[i];

// push points math here
...

// record the modified point position
aPointPositions[i] = oPointPosition;
aPointNormals[i] = oPointNormal;
}

// update the deformed mesh (again)
oPrimitive.GetGeometry().GetPoints().PutPositionArray( aPointPositions );

//



Thanks,

Matt



From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Hsiao Ming Chia
Sent: Thursday, April 24, 2014 5:35 AM
To: softimage@listproc.autodesk.com
Subject: Re: SDK: port groups in custom operators

Hi Matt,

There is no performance advantage with port groups.
In fact, there is extra logic invoked when connecting to a port group but once 
connected, they are just as fast.

http://softimage.wiki.softimage.com/index.php?title=Custom_Operators_(XSISDK)#1._PortGroups_make_it_easier_to_connect_an_operator_when_it_is_created

Thanks,
Hsiao Ming



 Original message 
From: Matt Lind mailto:ml...@carbinestudios.com>>
Date:
To: softimage@listproc.auto

RE: HQV Causing Major Slowness with File Save and Reference Model Updates

2014-04-23 Thread John Voltaire Tensuan
Hi,

Is the viewport in HQV mode when the reference model is being updated? If this 
is the case then HQV could indeed be slow as it may need to recompile hardware 
shaders for the models. If the viewport is not set to HQV and it is still slow 
then it could be another problem.

Assuming Windows, a big difference with using RDP is that you are limited to 
OGL 2.0 which is not supported by HQV.

Thanks

From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of John Richard 
Sanchez
Sent: Wednesday, April 16, 2014 11:45 PM
To: XSI List to post
Subject: Re: HQV Causing Major Slowness with File Save and Reference Model 
Updates

Awesome! Now I can watch more Houdini Tutorials!

On Wed, Apr 16, 2014 at 5:02 AM, Matt Morris 
mailto:matt...@gmail.com>> wrote:
Thanks Andy and researchers!

On 16 April 2014 09:59, Dan Yargici 
mailto:danyarg...@gmail.com>> wrote:
Thanks for the warning!

DAN

On Wed, Apr 16, 2014 at 9:49 AM, Nuno Conceicao 
mailto:nunoalexconcei...@gmail.com>> wrote:
Uau! Thanks Andy :)

On Wed, Apr 16, 2014 at 3:36 AM, Andy Jones 
mailto:andy.jo...@gmail.com>> wrote:
FOR IMMEDIATE RELEASE
April 15, 2014
SOFTIMAGE QUALITYBLEED VULNERABILITY
Discovered by Security Researchers Gibli, Barosin, Pancres, Friedman, Akita, 
Jones, Panisset, Barbieri and Piparo

Psyop experienced a "Eureka" moment today, when an artist discovered that 
updating referenced models was nearly two orders of magnitude faster when done 
through RDP (remote desktop protocol) rather than on a local workstation.

Simultaneously, a different artist in LA encountered issues with slowness 
saving files in Softimage, and a quick test confirmed that saving the scene via 
RDP was also two orders of magnitude faster.  This led to a flurry of 
troubleshooting, and we have since narrowed the problem down to Softimage's 
"High Quality Viewport" "feature."

The speed-ups after disabling HQV are nothing short of mind-blowing.  For 
example, unloading a referenced model took 250 seconds before the fix, and only 
3 seconds after the fix.  Meanwhile, a scene that took 15 minutes to save saved 
in only 30 seconds after the fix was deployed.

One artist's wife was quoted as saying, "Thanks to the Qualitybleed bug being 
fixed, my husband finally comes home from work on time!  Now if I can just get 
him to stop spending all his free time watching Houdini tutorials..."
Note that the "high quality viewport" preference that causes the problem is 
enabled by default, Psyop doesn't generally use HQV in our scenes, so people 
are likely to be affected by this problem whether they are HQV users or not.

To fix the problem, affected softimage users can run the following Python 
command:
Application.SetValue("preferences.Display.high_quality_viewport", False, "")
There is still much research to be done to find out what kinds of scenes/models 
are more susceptible to the problem, but we thought we'd bring it up now in 
case it's costing others time.  Given that the problem was tied in with RDP, 
it's likely that video drivers could be playing a role, but so far we weren't 
able to find any settings that would magically eliminate the problem without 
just disabling HQV entirely.

Psyop is on a mix of NVidia Quadros and we ran tests with a few different 
drivers, including the recommended ones.  We also saw the same problem across 
two different workstation images, in both Softimage 2013 and Softimage 2014, 
and on a remote worker's home workstation.  So we have reason to suspect it's 
not a highly specific aspect of our configuration that was causing the problem. 
 No testing has been done yet on Linux.
We will be sure to keep this list updated as more information becomes 
available.  Share your stories in the comments below if you have been affected 
by this ~100X slowdown in performance, or if you encounter a workstation that 
is somehow unaffected.





--
www.matinai.com



--
www.johnrichardsanchez.com
<>

RE: rendering multiple cameras not working?

2013-12-08 Thread John Voltaire Tensuan
This has been a legacy issue with 3rd party renderers when using the 
Framebuffer C++ SDK class to resolve the output path (basically, aside from the 
current pass being rendered, the framebuffer has no other information on which 
actual camera is being rendered currently). Because of this,  new SDK function 
overloads has been added to correctly resolve specific cameras in a camera 
group:

Framebuffer::GetResolvedPath( const CTime& in_rTime, const CRef& in_rCtx );
Framebuffer::GetResolvedPath( const CRef& in_rCtx );

They work exactly as the old Framebuffer::GetResolvedPath functions but this 
time they require a renderer context which would tell the function exactly what 
camera is currently being used.

-Original Message-
From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Eugen Sares
Sent: Friday, December 06, 2013 6:38 PM
To: softimage@listproc.autodesk.com
Subject: Re: rendering multiple cameras not working?

Hi, thanks for replying!
Redshift it is...

Am 06.12.2013 11:08, schrieb John Voltaire Tensuan:
> Hi,
>
> Are you rendering using Mental Ray or a third party renderer?
>
> Thanks
> -Original Message-
> From: softimage-boun...@listproc.autodesk.com 
> [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Eugen Sares
> Sent: Friday, December 06, 2013 8:14 AM
> To: softimage@listproc.autodesk.com
> Subject: rendering multiple cameras not working?
>
> Hello,
> is it possible that the 'render multiple cameras' feature is buggy?
> (2014SP2)
> I created a camera group, chose it in the pass, added the [Camera] token to 
> the channels filenames, and the images overwrite each other. Looks like the 
> camera name is not updated.
> Thanks!
> Eugen
>
> ---
> Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz 
> ist aktiv.
> http://www.avast.com
>


---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz 
ist aktiv.
http://www.avast.com

<>

RE: rendering multiple cameras not working?

2013-12-06 Thread John Voltaire Tensuan
Hi,

Are you rendering using Mental Ray or a third party renderer?

Thanks
-Original Message-
From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Eugen Sares
Sent: Friday, December 06, 2013 8:14 AM
To: softimage@listproc.autodesk.com
Subject: rendering multiple cameras not working?

Hello,
is it possible that the 'render multiple cameras' feature is buggy? 
(2014SP2)
I created a camera group, chose it in the pass, added the [Camera] token to the 
channels filenames, and the images overwrite each other. Looks like the camera 
name is not updated.
Thanks!
Eugen

---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz 
ist aktiv.
http://www.avast.com

<>

RE: Open GL High Quality ?

2013-12-06 Thread John Voltaire Tensuan
What I would do is to make an ICE tree that writes the fog color based from the 
distance of the camera to the current vertex and write it to a CAV. The render 
tree can then read the CAV and multiply it to the final color.

This is my suggestion because HQV doesn't support all the MR nodes and from the 
top of my head I don't recall any HQV supported node that can give you your 
surface and camera positions.

Another option of course is to write custom realtime shaders for it.

-Original Message-
From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of olivier jeannel
Sent: Wednesday, December 04, 2013 5:41 AM
To: softimage@listproc.autodesk.com
Subject: Re: Open GL High Quality ?

Ah thank's Luc Eric !
I lost the job, but how would I make a RealTime fog then ? Is there something 
already usable, or is there something to build with a ScalarState/RayLength ?
I saw bizarre shader with ready made grid... Realtime OGL seems very opaque to 
me...


Le 03/12/2013 17:45, Luc-Eric Rousseau a écrit :
> OK, since no one discussed it, here is the explanation as to why the 
> High Quality Viewport does not implement depth cut/fog.
>
> The fog parameter in the display setting is an OpenGL 1.x feature, 
> "glFog".  Like all old OpenGL features, "fixed pipeline" stuff, it is 
> not implemented with fragment shaders.  When you use fragment shaders, 
> the shader must implement *everything*, lighting/shading/texturing.
> If it were to be fog, than it's up to that shader to implement that.
> When you switch to any real time shader viewport in Softimage, fog 
> ceases to work, because it's no longer the opengl fixed pipeline 
> driving this stuff, it's your render tree.
>
> Now, what is the HQV?  It's not an OpenGL 1.x emulator, it's your
> render tree compiled as realtime shader format with MetaSL.   When you
> draw a render region there is no fog. The "phong" in Softimage/Mental 
> Ray does not have a fog parameter.
>
> So what you need to do is to make a render tree that implements that 
> fog shading.
>
> On Mon, Dec 2, 2013 at 4:54 AM, olivier jeannel  
> wrote:
>> Joke aside,
>> I'm consulted for WebGL aplication. I just wanted to rough-up a scene 
>> (which has to include fog and normal maps) in XSI to kind of make a 
>> fast preview and set some lighting /ambient.
>> It's completly useless here...
>

<>

RE: No anti aliasing while navigating?

2013-06-18 Thread John Voltaire Tensuan
In 2014, the built-in AA is disabled by default when you are interacting with 
the viewport and unfortunately there is no option to revert to the old 
behavior. If you are on Windows with an NVidia/ATI card and fairly recent 
drivers, you should be able to get around this forcing the driver to enable AA 
all the time:

NVidia Cards:

1)  Open up the Nvidia control panel (from Control Panel or by right 
clicking on the desktop)

2)  Click on "Manage 3D settings"

3)  Open up the "Program Settings" tab

4)  Click on "Add"

5)  Find the Softimage executable (by default it should be in "C:\Program 
Files\Autodesk\Softimage 2014\Application\bin\xsi.exe")

6)  You should now see settings specific for Softimage only, find the 
setting "Antialiasing - Mode" and change it to "Override any application 
setting"

7)  Select your preferred AA level in "Antialiasing - Setting"

8)  Click on "Apply"


ATI Cards:

1)  Open up the Catalyst Control Center

2)  Click on "3D Application Settings" (where it is located depends whether 
you are in the Standard View or Advanced View)

3)  Uncheck the "Use application settings" under the Anti-Aliasing group 
and check the check box on its right

4)  Select your preferred AA level.

5)  Click on "Apply"

For ATI cards, you won't have per-app settings so you'll need to revert to the 
default settings if you want to use a different 3D app. If you can't find the 
NVidia Control Panel or the Catalyst Control Center, you are probably using the 
drivers that came with Windows and you'll have to update them to a more recent 
version.

From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of James De Colling
Sent: Tuesday, June 18, 2013 8:00 AM
To: softimage@listproc.autodesk.com
Subject: Re: No anti aliasing while navigating?

having just upgraded here, im finding the same thing. whats happened? I cant 
find any checkbox for AA whilst navigating.

James,

On Tue, Jun 11, 2013 at 6:19 PM, Christian Gotzinger 
mailto:cgo...@googlemail.com>> wrote:
Hi list,
I turned on the High Quality viewport in SI 2014 in my scene to get 
anti-aliasing. But the anti-aliasing only works when the camera is stationary. 
As soon as start navigating, I get the old pixelated mess. I want it to be 
enabled all the time, not just when I stop navigating. What gives?

Thank you

<>

RE: [C++] Store a structure of vector in a UserData

2013-06-13 Thread John Voltaire Tensuan
I'd recommend going with Guillaume's suggestion with a bit of modifications. 
Currently it won't work because the vectors would be freed when "Foo Test" gets 
out of scope because of automatic destruction. Making the allocation and 
de-allocation of the vector manual should do the trick:

struct Foo{
std::vector *A;
std::vector *B;
bool C;
bool D;

void init()
{
A = new std::vector;
B = new std::vector;
}
void destroy()
{
delete A;
delete B;
}
};
...
Foo Test;
//Allocate the vectors
Test.init();
//Set some values
Test.A->pushback(12);
Test.B->pushback(24);
Test.B->pushback(32);
Test.C->pushback(true);
Test.D->pushback(false);

 myMap.PutItemValue( i, (unsigned char*)&Test, sizeof( Foo )) ;
// Get them back
const unsigned char* pInternalData = NULL ;
UINT cntData = 0 ;
myMap.GetItemValue( 0, pInternalData, cntData ) ;

Foo *pData = (Foo*) pInternalData ;
if(pData)
{
Application().LogMessage("nb  "+CString(pData->A->size()));
}
// Free the vectors
pData->destroy();

As a rule of thumb, be careful when putting structs with non-trivial copy 
constructors (such as stl containers) into UserDataMap as it treats your 
UserData as raw memory and thus won't follow C++ copy semantics.

From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Ahmidou Lyazidi
Sent: Wednesday, June 12, 2013 4:41 PM
To: softimage@listproc.autodesk.com
Subject: Re: [C++] Store a structure of vector in a UserData

Thanks for the example, I'll try tonight!
I also started to mockup a simple version, and surprise, it's working..
I'll keep you informed if I find where the problem is.

Cheers

---
Ahmidou Lyazidi
Director | TD | CG artist
http://vimeo.com/ahmidou/videos
http://www.cappuccino-films.com

2013/6/10 Marc-Andre Belzile 
mailto:marc-andre.belz...@autodesk.com>>
1) Assigning buffer to a std::vector (copy data)

Std::vector v(buffer,buffersize);

2) std::vector wrapper (untested)

struct Wrapper : public std::vector
{
Wrapper( double* buffer,size_t size )
{
// initialize stl internals with buffer
this->_M_impl _M_start = buffer;
this->_M_impl _M_finish = this->_M_impl _M_end_of_storage = buffer + size;
}

~Wrapper()
{
// nulls out internals to avoid deallocation from stl
this->_M_impl _M_start = this->_M_impl _M_finish = 
this->_M_impl _M_end_of_storage = NULL;
}
};

I think boost have already a similar class, but boost is a big hammer for such 
a tiny nail!

-mab


From: 
softimage-boun...@listproc.autodesk.com
 
[mailto:softimage-boun...@listproc.autodesk.com]
 On Behalf Of Guillaume Laforge
Sent: Monday, June 10, 2013 8:53 AM
To: softimage@listproc.autodesk.com
Subject: Re: [C++] Store a structure of vector in a UserData
Hi Ahmidou,

I'm often storing just a pointer to an array/buffer/vector to pass any struct 
to a User Data and it is working fine.
It is hard to help you without seeing more chunks of your code :).
Maybe you could try to repro the issue on a simpler code that you could share 
here ?

Cheers,

Guillaume
On Mon, Jun 10, 2013 at 4:33 AM, Ahmidou Lyazidi 
mailto:ahmidou@gmail.com>>>
 wrote:
Thanks everyone, unfortunatly I'm still stuck.

@ Stephane, this is what I'm doing, but it's not working:
sizeof( test.A ) + sizeof( double ) * test.A.size() + sizeof( test.B ) + 
sizeof( double ) * test.B.size() + sizeof( bool ) * 2
@ Guillame
Thanks, I tryed your example but I'm probably doing it the wrong way:

Foo Test;
//Set some values
Test.A->pushback(12);
Test.B->pushback(24);
Test.B->pushback(32);
Test.C->pushback(true);
Test.D->pushback(false);

 myMap.PutItemValue( i, (unsigned char*)&Test, sizeof( Foo )) ;
// Get them back
const unsigned char* pInternalData = NULL ;
UINT cntData = 0 ;
myMap.GetItemValue( 0, pInternalData, cntData ) ;

Foo *pData = (Foo*) pInternalData ;
if(pData)
{
Application().LogMessage("nb  "+CString(pData->A->size()));
}
this return empty vector
@MAB
Could you point me to some ressources on the web about this?
Thanks!!


---
Ahmidou Lyazidi
Director | TD | CG artist
http://vimeo.com/ahmidou/videos
http://www.cappuccino-films.com
2013/6/10 Marc-Andre Belzile 
mailto:marc-andre.belz...@autodesk.com>>>
Alternatively, you could store C++ buffers in your struct instead of 
std::vector objects. Then if you need to access your data with stl, just assign 
each buffer to an std::vector out from these buffers.

If you can't afford the extra copy

RE: SDK: OGLLight

2013-02-06 Thread John Voltaire Tensuan
Hi Matt,

Working with vertex/fragment shaders is usually only goes one-way meaning you 
can upload the parameters to the shader but the shader itself usually cannot 
send its results back to the calling code (I believe there are extensions to do 
this but I'm not sure about the driver support for these and I also don't have 
much experience with them).

If what you want is the world coordinates inside the fragment shader, what you 
can do is:


1.   Create a new uniform variable in your vertex program so that your C++ 
code can feed the vertex program the current world matrix (e.g. uniform mat4 
world_matrix)

2.   Create a new varying variable for the world position in your vertex 
and fragment programs so that the vertex program can give the fragment program 
the world position it has calculated (e.g. varying vec4 world_pos)

3.   Feed the world_matrix uniform the proper matrix in your C++ code via 
the glGetUniformLocation*/glUniform* functions (I think the code I sent you 
already does this inside SetTransforms())

4.   Set the world_pos varying variable inside your vertex program so that 
it can be properly read inside the fragment program

So in your vertex program you'll have:

varying vec4 world_pos;
uniform mat4 world_matrix;
...
void main()
{
...
world_pos = world_matrix * gl_Vertex;
...
}

And in the fragment program you can read what worldPos is just by declaring the 
same varying variable and using it like an ordinary variable inside the code:

uniform vec4 light_pos; // Some other uniform that you might want to add
varying vec4 world_pos;
...
void main()
{
...
float fDist = distance(world_pos.xyz, light_pos.xyz); // Do 
something with world_pos
...
}

Regards,
John
From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Matt Lind
Sent: Thursday, February 07, 2013 11:00 AM
To: softimage@listproc.autodesk.com
Subject: RE: SDK: OGLLight

I'm used to writing mental ray shaders.  Mental ray uses different coordinate 
spaces for every scene item which means shader code contains many conversion 
routines to do simple stuff like diffuse shading.

I'm still getting my feet wet with OpenGL shaders using the Phong shader you 
sent me a while back.  As a learning exercise I'm attempting to extend it to 
support point and spot lights.  I initially experienced funky lighting when the 
point light was inserted into a hierarchy and moved around the scene, but then 
I caught my mistake and removed the computations that consider light 
orientation.

One sticking point I have right now is how to get the world coordinate of the 
current shaded pixel.  I see it defined in the vertex shader source (GLSL), but 
how do I read that into the C++ code so I can work with it further?  All the 
calls I see in the C++ code push values from C++ into the vertex/fragment 
shaders.  I need to go the other direction.


Thanks,

Matt




From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of John Voltaire 
Tensuan
Sent: Wednesday, February 06, 2013 6:46 PM
To: softimage@listproc.autodesk.com
Subject: RE: SDK: OGLLight

Hi Matt,

Coordinates returned by OGLLight should all be in global space. Are you seeing 
any weird behavior with it?

Thanks,
John

From: 
softimage-boun...@listproc.autodesk.com<mailto:softimage-boun...@listproc.autodesk.com>
 [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Alok
Sent: Thursday, February 07, 2013 7:37 AM
To: softimage@listproc.autodesk.com<mailto:softimage@listproc.autodesk.com>
Subject: Re: SDK: OGLLight

Should be global, but again not sure

[cid:image001.gif@01CE053A.75707770]
On 06/02/2013 6:34 PM, Matt Lind wrote:
Let me rephrase - what coordinate space is returned: local? Global? Screen? 
Normal? Camera?


Thanks,

Matt



From: 
softimage-boun...@listproc.autodesk.com<mailto:softimage-boun...@listproc.autodesk.com>
 [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Alok
Sent: Wednesday, February 06, 2013 3:23 PM
To: softimage@listproc.autodesk.com<mailto:softimage@listproc.autodesk.com>
Subject: Re: SDK: OGLLight

Not sure, but as far as I can remember, it uses homogenous coordinates so point 
(x, y, z) is represented as (xw, yw, zw, w). If you are getting a return of 
four scalars and want to convert to 3d cartesian , simply divide the first 
three values by the fourth value.

Maybe I am wrong, but not completely.

[cid:image001.gif@01CE053A.75707770]
On 06/02/2013 5:58 PM, Matt Lind wrote:
Anybody know what coordinate space is used for the values returned by the 
OGLLight? (e.g. OGLLight.GetLightPosition(), OGLLight.GetLightDirection(), ...)

The documentation doesn't specify.

Matt
No virus found in this message.
Checked by AVG - www.avg.com<http://www.avg.com>
Version: 2012.0.2238 / Virus Database: 2639/5585 - Release Date: 02/06/13


RE: SDK: OGLLight

2013-02-06 Thread John Voltaire Tensuan
Hi Matt,

Coordinates returned by OGLLight should all be in global space. Are you seeing 
any weird behavior with it?

Thanks,
John

From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Alok
Sent: Thursday, February 07, 2013 7:37 AM
To: softimage@listproc.autodesk.com
Subject: Re: SDK: OGLLight

Should be global, but again not sure

[cid:image001.gif@01CE0520.5396D7D0]
On 06/02/2013 6:34 PM, Matt Lind wrote:
Let me rephrase - what coordinate space is returned: local? Global? Screen? 
Normal? Camera?


Thanks,

Matt



From: 
softimage-boun...@listproc.autodesk.com
 [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Alok
Sent: Wednesday, February 06, 2013 3:23 PM
To: softimage@listproc.autodesk.com
Subject: Re: SDK: OGLLight

Not sure, but as far as I can remember, it uses homogenous coordinates so point 
(x, y, z) is represented as (xw, yw, zw, w). If you are getting a return of 
four scalars and want to convert to 3d cartesian , simply divide the first 
three values by the fourth value.

Maybe I am wrong, but not completely.

[cid:image001.gif@01CE0520.5396D7D0]
On 06/02/2013 5:58 PM, Matt Lind wrote:
Anybody know what coordinate space is used for the values returned by the 
OGLLight? (e.g. OGLLight.GetLightPosition(), OGLLight.GetLightDirection(), ...)

The documentation doesn't specify.

Matt
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2238 / Virus Database: 2639/5585 - Release Date: 02/06/13

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2238 / Virus Database: 2639/5585 - Release Date: 02/06/13

<>