prman-pixar / RenderManForBlender

RenderMan for Blender render addon
MIT License
808 stars 134 forks source link

OpenGL Material Preview Improvements #124

Closed mifth closed 7 years ago

mifth commented 9 years ago

Hi.

Cycles has good material preview in Material Mode. It can preview shader colors and textures. Here is example:

File: https://dl.dropboxusercontent.com/u/26887202/blender/temp_pr.blend

Image: _002

Is it possible to add to PRMAN?

bsavery commented 9 years ago

Thanks. The interactive preview with PRMan is meant to do something similar, and I think the advantages and disadvantages have been covered elsewhere. Mainly that it's not using the blender window currently and we're able to update lights, camera, materials but not move geometry without restarting the interactive render. However we get the fully lit/shaded result.

mifth commented 9 years ago

Wait, wait. This is blender's opengl part. Just open my blend file and check the left window. Shader cooors and textures are displayed in 3d viewport.

The right window is just comparison for cycles renderer and the 3d material viewport. Also, cycles material nodes to see what happens.

bsavery commented 9 years ago

Gotcha. Yeah I'm not that great with opengl stuff. It might not be too hard to implement doing material preview in the viewport. I'm going to relabel this thread.

Ideally someone who is really good with opengl could focus on this.

bsavery commented 9 years ago

The other issue is that it would be a ton of work to translate all the Bxdfs to opengl, but I'm sure something simple could be done.

mifth commented 9 years ago

Thanks for confirmation. It's not a ton of work i think. You have not so much shaders. Desney, skin, glass, susurf... All you need is just to get input color/texture of a shader.

Also cycles is the python addon. You can check it in blender's scripts folder. They implemented it through the python addon too.

mifth commented 9 years ago

Cycles Addon is located here: _004

You can just grab the code of the preview of colors and shaders in MaterialMode.

bsavery commented 9 years ago

Any chance you'd be willing to contribute that code with a pull request? I can take a look but I'm a bit busy this week.

Lightye commented 9 years ago

It would be awsome with some real open-GL connections. However, if it is a bit too much to do at the moment, one suggestion could be the following. If possible, maybe try to just copy the colors of diffuse to the underlying Blender materials (that is already connected to lights), and maybe set "texture" display as default. It is quite a cheat, but if it is possible to copy the color temporarily it would at least "look" much better than boring grey. Otherwise, if there is someone who would like to do it properly, please just ignore this simple idea. Anyway, you are doing an awesome investment. Cheers!

Lightye commented 9 years ago

Sorry guys for the many posts. This idea has been popping back a few times, and after seeing a demo of Maya 2016 I think it might not be a good idea to go down the open-GL path. There are several reasons. The first is that I'm a WYSIWYG-guy. Second, translating everything between RenderMan and open-GL might be a waste of time. Third, maybe RenderMan will add native support for graphic cards (since there is research underway). So what I propose is something like this: http://sawe.asuscomm.com/published/renderman/blender/gui_proposals/20150903_interactive_with_wire_overlay_proposal.jpg. Sorry that I'm not a good programmer, however, I did open-GL in university level, and honestly, the capabilities are so limited who really wants it? I would maybe propose that we let the users use a limited sub-set of RenderMan if they want faster display. Just tell me to shut up if you think I'm totally lost here. However, these are my honest ideas, and since I'm a Photoshop guy I can try out ideas if you want, graphically. So they can be discussed I mean, pros and cons. Maybe those things could be developed? Cheers!

MWY3510 commented 9 years ago

Lightye,

I'm trying to understand what you are suggesting. What I think you're proposing is similar to the view-port rendering of cycles but with a wire-frame overlay. Let me know if I am mistaken or am missing something.

MWY3510

Lightye commented 9 years ago

You are on the spot.

Lightye commented 9 years ago

It does not necessarily hinder a separate open-GL thing, but honestly if I want open-GL I could use Cycles or Blender. Blah, sorry for the many posts. Maybe we should go another way than Maya and the other guys and innovate.

Lightye commented 9 years ago

In this video https://www.youtube.com/watch?v=5obEtnSBkBE they talk about converting stuff between different "renderers", and as an artist I just think it suck to need to convert. Why not use the right thing from the beginning, and downgrade or disable features if needed?

bsavery commented 9 years ago

^^^^ this. I think it depends how much time you want to spend translating RIS pattern networks. If just getting color and some basic lights into opengl is good enough, then that's simple. However if you don't want to always be chasing converting more things to opengl, then the ultimate goal would be to be able to do everything in a "PRMan viewport" that would let you add geometry, and move and do everything you want.

MWY3510 commented 9 years ago

I think a hybrid solution would be the best. 1) A basic openGL preview mode that has lighting and color information. 2) A PRMan viewport option that as bsavery says would show everything.

MWY3510

bsavery commented 9 years ago

Just to be clear the current IPR in PRMan has limitations now but of course will improve over time.

Lightye commented 9 years ago

So will the machines.

Lightye commented 9 years ago

Adding ability to disable camera rays on everything but selected could do a lot for those with a few cores only.

MWY3510 commented 9 years ago

bsavery,

So as IPR improves should we look into integrating it into the viewport?

MWY3510

Lightye commented 9 years ago

Hey guys, I don't want to put pressure on you. In the end a hybrid where the user can choose one or two editors for interactive display would probably be rock solid. However, considering using open-GL a lot or spending time with that I just think is such a waste at the moment. Those who do lighting and materials want to see as closely as possible what the end result will be, not some "maybe it will look something like that". Animators could just use Blender default or Cycles, but lighters can use PRMan interactive. Great work with all that you do, prman is really a great renderer and the quality look amazing. Cheers!

Lightye commented 9 years ago

Maybe I can try to do a video demo to see what a hybrid with wireframe overlay could look like.

MWY3510 commented 9 years ago

Lightye,

Sounds great, I still think that only the basic gl part of the hybrid is possible at the moment.

Lightye commented 9 years ago

That's fine.

http://sawe.asuscomm.com/published/renderman/blender/gui_proposals/20150904_prman_for_blender_renderman_with_wire_overlay.mp4

Lightye commented 9 years ago

A miniature interactive view with separate basic open-GL or wire. http://sawe.asuscomm.com/published/renderman/blender/gui_proposals/20150904_interactive_with_it_alternative.png.

A secondary viewer, small, and similar to the Navigator window in PS. http://sawe.asuscomm.com/published/renderman/blender/gui_proposals/20150904_navigator_in_ps.png

For modelers there is already matcap with screen-AO. http://sawe.asuscomm.com/published/renderman/blender/gui_proposals/20150904_matcap_with_wire_for_modeling_already_done.png.

Cons regarding wire overlay with interactive prman:

Lightye commented 9 years ago

A test with using "Background Images" as Render Result. The image only update when redrawed (e.g. adjust Opacity). render_as_background_almost_already_supported

bsavery commented 8 years ago
screen shot 2016-01-31 at 6 55 55 pm

Like this?

MWY3510 commented 8 years ago

Great Brian. What did you do to get that result.

bsavery commented 8 years ago

Using the new "internal" display driver and then copy the render result to the background. Just playing around with things. It's still testing and need to see about getting the display driver working for ipr...

MWY3510 commented 8 years ago

Great things will come from having IPR and the internal display driver working together.

Lightye commented 8 years ago

It is nice to see some progress in this area as well. Regarding the wire on IPR concept please consider that for example industrial designers, architects and traditional animators are used to seeing some guidelines (cross sections) on their sketches. Blender has some "optimal display" mode that will reduce those wire lines to only a few when using the subdiv modifier. It is already fairly easy to toggle the display of wireframe as well if a user would like to see IPR only. As a shader developer and lighter this is actually what you want to see (they basically want to check that the shader setup works for each part). If a shader/lighting artist can go through all the assets in a scene using some kind of "IPR selected only" and then finally batch render them all out together with some kind of ID/material-mask (or equivalent) to use in post it should be effective. Final (fine) tweaking can then be done in Post and not in Blender. Such a workflow idea could be pushed, optimized and finally presented. It should provide less waiting, more interactivity, and maximized control. Imagine doing this on a very high-end workstation and then sending the batch to a strong rendercow. A company/professional would need two strong multicore computers and one license (if the free can be used to setup the scene, and the commercial for the rendercow). Based on my experience, these are just some thoughts. Alternative workflows could work also.

Lightye commented 8 years ago

Other workflows could be if time allow re-rendering the tweaking could be done in Blender (using preview quality) and not in post using ID/material masks. The user can choose if they want to tweak in Blender (first render) or in Post. Probably a combination is good, i.e. initial tweaks in Blender with preview quality and then allow final tweaks in Post. ID/material-masks should be possible to render out quickly as needed during the post step (this is somewhat how Magoo, a "GI/raytracing" firm do it). Cheers!

mifth commented 8 years ago

Yes! It looks great! All we need - color and texture in the viewport.

Lightye commented 8 years ago

It is hard to wait for this. I have a feeling that if this is done well, all the way, it will be a knockout. WYSIWYG Man!

Lightye commented 8 years ago

Mifth, if no RenderMan Nodetree is attached the color of the Bxdf diffuse is already displayed in the viewport. However, when a nodetree is attached with for example PxrDisney the color of the viewport is not the same. If it would be possible to copy that color value from somewhere lower down the pipe it would maybe be better? What about some average of the center of the Preview?

bsavery commented 8 years ago

Ahem, check out the latest github code from last night ;)

On Tue, Feb 2, 2016 at 11:02 AM, Lightye notifications@github.com wrote:

Mifth, if no RenderMan Nodetree is attached the color of the Bxdf diffuse is already displayed in the viewport. However, when a nodetree is attached with for example PxrDisney the color of the viewport is not the same. If it would be copy that color value from somewhere lower down the pipe it would maybe be better? What about some average of the center of the Preview?

— Reply to this email directly or view it on GitHub https://github.com/bsavery/PRMan-for-Blender/issues/124#issuecomment-178760004 .

brian.savery@gmail.com 508-274-8700

Lightye commented 8 years ago

That's sweet and even faster. Checked base color for the following and they are all connected to the openGL color (diffuse or specular): PxrConstant, PxrDiffuse, PxrDisney, PxrGlass (transmission), PxrLMDiffuse (front color), PxrLMGlass (Transmission), PxrLMMetal (specular), PxrLMPlastic (Diffuse), PxrMarschnerHair (Diffuse Color), PxrSkin (midColor), and PxrVolume (Diffuse color).

PxrLMSubsurface is excluded (maybe not necessary).

That is well executed and neat. The interactive feedback here is fast and can be used for animating characters and doing previz.

Lightye commented 8 years ago

Guys, please keep an eye on what happens when a mesh already have another shader assigned (for example from Cycles).

Edit: Aha, the button "Use shader nodes to render the material" will block the color display if enabled.

Lightye commented 8 years ago

This simple visual feedback simplifies editing very much!

Lightye commented 8 years ago

Here's a bug/limitation: Changing a color from the Properties Editor works great, but not when doing it via the Node Editor. The color will change in the Node Editor and the Properties Editor, but not transfer to the 3D View (editor). If, however, Presence is adjusted in the Properties Editor the new color will then be transfered.

mifth commented 8 years ago

Hi.

I updated the code but there still no colors in the viewport. Did you add them? Or we still need to wait? selection_032

MWY3510 commented 8 years ago

mifth,

This feature is in the plugin. In order to see the color you do need to adjust the color option once just to make it show up. Have a great day.

bsavery commented 8 years ago

ALso make sure your have material viewport shading turned on...

bsavery commented 8 years ago

Which it appears you do.

MWY3510 commented 8 years ago

Well solid shading also works. It only shows the color though not any of the lighting information. Just noting this, I am not disagreeing with anything Brian said.

On Mon, Feb 15, 2016 at 5:23 PM, bsavery notifications@github.com wrote:

Which it appears you do.

— Reply to this email directly or view it on GitHub https://github.com/bsavery/PRMan-for-Blender/issues/124#issuecomment-184421089 .

bsavery commented 8 years ago

Right.

On Mon, Feb 15, 2016 at 2:25 PM, MWY3510 notifications@github.com wrote:

Well solid shading also works. It only shows the color though not any of the lighting information. Just noting this, I am not disagreeing with anything Brian said.

On Mon, Feb 15, 2016 at 5:23 PM, bsavery notifications@github.com wrote:

Which it appears you do.

— Reply to this email directly or view it on GitHub < https://github.com/bsavery/PRMan-for-Blender/issues/124#issuecomment-184421089

.

— Reply to this email directly or view it on GitHub https://github.com/bsavery/PRMan-for-Blender/issues/124#issuecomment-184422578 .

brian.savery@gmail.com 508-274-8700

mifth commented 8 years ago

I adjusted all colors but nothing happened. I tried the material viewport too. I'm on linux.

selection_033

mifth commented 8 years ago

I opened log and found this http://pastebin.com/3h7x4U7M

bsavery commented 8 years ago

We should update this with 21 to match PxrSurface

bsavery commented 7 years ago

Closing. I don't think we are going to fix this any better than it is now.