Jump to content
Atom

OpenGL 2.1 Viewport Shader?

Recommended Posts

Hi All,

 

I am looking for a way to display images in the MacMini viewport using H14 or above. This is not a problem for other programs like C4D and Blender and I am told by developers this is because those programs may be using OpenGL2.1 and Houdini uses a higher version 3.2 or something which makes Houdini less compatible with low end hardware.

 

I know Houdini has a flexible viewport shading system that allows end users to write OpenGL code to drive a specific object's display in the viewport.

 

Does anyone have a working OpenGL 2.1 UV Map display shader around?

Also how do I link such a material to an object so I can see the result in the viewport?

 

Thanks

Edited by Atom

Share this post


Link to post
Share on other sites

Unfortunately you can't use a GL2.1 shader on the Mac because the core profile does not allow it. It is allowed on other platforms that support the compatibility profile (Nvidia or AMD, Win/Linux).

 

This was one of the main issues with going to GL3 on the mac from GL2 - it's an all-or-nothing change.

 

To create a GL3 shader, do

 

1) File > New Operator Type, Style = SHOP, Net Type = GLSL Shader

2) In the fragment shader, edit wire uv to color by chaning:

ptcol = fsIn.color.rgb * fsIn.colora;
  // to
ptcol = vec4(uv, 0.0, 1.0);

Then apply that shader to the object to visualize uv.

 

Edit: Alternatively you can use a color visualizer with the Attribute set to 'uv' for this.

Share this post


Link to post
Share on other sites

A side question; would you consider making a masterclass on the viewport GLSL and other viewport options?  All the new videos for H15 are very helpful.

Share this post


Link to post
Share on other sites

Thanks Mark,

That produces a red and black diagonal stripe pattern across my geometry. It worked on a Mac Pro running a nVidia Quadro, here at work, but the real test will be if it works on my MacMini at home. It does look better than just plain solid white.

I noticed there was a new TAB added to the Display properties between H13 and H14 that is titled "Visualizers". Is that the alternate area you are referring to? I have not really investigated that feature yet.

Is there a way to get an image map to appear instead of the stripes?

post-12295-0-96797400-1445274799_thumb.p

Edited by Atom

Share this post


Link to post
Share on other sites

That basically means the shader failed to compile. Try test compiling it in the Type Props, Code tab to see what it's unhappy about.

 

Edit: Now that I have a working Houdini session in front of me, it's:  ptcol = vec3(fsIn.texcoord0, 0.0);

Share this post


Link to post
Share on other sites

Ah, good to know.

I created a New Operator Type and it fails to compile even without me modifying code. H14.444. I think I'll try to upgrade and try again.

Edited by Atom

Share this post


Link to post
Share on other sites

I want to see reflection, shadow, AO and DOF working. An Uber Viewport Shader!

Share this post


Link to post
Share on other sites

Next would be to also run over the new visualisers, show us more advanced uses of them cool tricky stuff that can be done.

 

Also another advanced topic could if one could implement showing only a few of the onscreen attributes at a time, i.e. show a maximum of 100 point numbers instead of all point numbers. i.e. Softimage.

 

Also it would be good to cover the new PBR/GGX features, the advantages compared to the previous H14 viewport. An example of the types of questions people have is why is PBR so much better, "isn't almost the same as out previous tech."  I like the answer over at GameDev to this:

 

http://www.gamedev.net/topic/672836-pbr-metalness-equation/#entry5259702

 

dpadam450, on 30 Oct 2015 - 7:23 PM, said:

snapback.png

The equation you posted has been around forever. This is the same thing I've been using for 10 years (except for the G part) unless I missed something big.

If you're not using the G part, then you're not using Cook Torrence model. Most PBR shaders used by games seem to be Cook-Torrence / or other microfacet models.

Edited by marty

Share this post


Link to post
Share on other sites

Any possibility to do things like path tracing in the viewport:

 

Edit: also the difference and uses of deferred shaders and others. 

Edited by marty

Share this post


Link to post
Share on other sites

Next: please run over how the viewport is used to actually process data. i.e. the solvers don't solve if the viewport is not visible. 

 

Edit:  the Texture tab of the Display Options would be good to run through. i.e. 3D Textures limits to show less volumes, and the use of the other 2d and Dynamic texture bits. 

Edited by marty

Share this post


Link to post
Share on other sites

Next: please run over how the viewport is used to actually process data. i.e. the solvers don't solve if the viewport is not visible.

 

That's true of any viewer in Houdini, though - they cause cooks by requesting the data from a node. If nothing pulls the data, it doesn't cook. That holds true for all obvious viewers (Scene, Composite view, CHOPs graph) as well as things like the Geometry Spreadsheet.

  • Like 1

Share this post


Link to post
Share on other sites

Maybe also cover suggestions for further reading/ideas to steal? Eg, I know shadertoy isn't really the same thing, but there must be other forums or places where modern ogl stuff is shared and discussed.

 

Maybe also a quick summation of common features between vex and ogl, and areas to definitely avoid?

Share this post


Link to post
Share on other sites

I would be happy to see a viewport shader like this:

 

C5BXq.jpg

 

The default gray material is too washed out and is really hard to read details IMO.

Share this post


Link to post
Share on other sites

Definitely technical things mentioned above.

Also (some of them are repeating just to put my voice for them:)

It would be nice to cover topic about Visualizers as mentioned. Especially tips and hidden gems not shown in other H15 videos how to utilize them effectively. Especially not so known or obvious usage like ability of using groups and expression in groups to display only percentage of the items (E.g: *:10)), advantage of Volume visualizers over older methods and so on.

How to match viewport (gamma/LUT) to rendered image (including settings for color correction toolbar and gamma/lut correction of the background in 3d viewport) - it's basic stuff but could be nice to have it demonstrated properly in one place (as color correction toolbar is hidden by default).

Explanation of the HDR, AA and various caches and it's settings and how it affects performance and available VRAM for OpenCL computation.


I have to agree that it's not well known that various viewers could slowdown computation a lot.
(E.g.: Like cooking different nodes that are not needed (inactive branch) just by having Geometry Spreadsheet opened with that node selected and so displayed). Slowing down OpenCL smoke simulation by caching it to the ram and visualizating each frame in 3d viewport instead of writing it directly to the disk and so on.)

 

About GLSL: pointing user to the example folder, adding tips what is best to avoid and why in creating custom glsl in Houdini. Tips to good resources are always welcomed.

 

 

Cheers,

Petr

  • Like 2

Share this post


Link to post
Share on other sites

The Memory toolbar, and the dreaded construction plane.... maybe just run through the whole relatively unused 'persp1' menu

Edited by marty

Share this post


Link to post
Share on other sites

Would be good to put into the video where you show the connection of OpenGL viewport to a Shop/Vop shader. Probably the first question anyone asks getting into Houdini.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×