Jump to content

really fast fake scattered emission in volumes


anupamd

Recommended Posts

So, the scattered emission in Pyro looks nice, but its obviously a lot slower than not scattering (im getting about a 5x to 10x slowdown depending on size of volume)

All Im looking for is a basic kitchen sink scattering, it doesnt have to be physically realistic. really all it needs to be is a blurred and/or resampled version of the heat field. think of it like blurring an image in comp.. same principle but just blurring the volumes instead.

So now is where I hit a roadblock because I know what i want to do but I dont have a lot of experience manipulating volumes especially ones that change over time.

Here is what I want to do.

Starting with some cached volume that contains density/heat/velocity..the usual fields.

1. Load the volume. (dopio? file?)

2. Create a new volume with the same dimensions as the original fluid container. (just refer to the container size with a channel expression)

2. Isolate the heat field somehow so I can perform a volume blur on just the heat field (alternatively, can also try a volume resample)

3. copy this over to the new volume

4. merge the new volume with the existing pyro volumes.

5. Write back out to disk as heat_blurred.

Also, I suppose instead of doing this as a post process on cached data, I could do this in DOPS as the last step before caching to disk. That would be more efficient.

***So the REAL lapse of knowlege here is.. how does one do the above manipulations in DOPS.

Finally in the pyro shader, I want the fire density field to be calculated something like (heat*heat_scale)+(heat_blur*heat_blur_scale). So I'd have to modify the pyro shader a bit.

Im basically mixing in a bit of the blurred heat field with the unblurred (and ideally more sharp looking) heat field. That way I get very sharp details in my fire and a very blurry wide falloff that simulates some scattering.

Blurring volumes is fairly fast, and the resolution of the blurred volume doesnt have to be that high, volume resample works too but might get artifacts.

So I think that would work for some really fast fake scattering no?

I'm going to try some things but I'd love some extra advice on this.

-A

Edited by anupamd
Link to comment
Share on other sites

Ok here is an initial trial in dops. I remember back to bunkers pyroclastic smoke example.. gas match field to make a copy of the heat field. Gas blur the heat field. then in SOP space make sure to import the blurred heat field (import pyrofields) and that should give me all the data I need.

I suppose if I were doing uprezzing, I'd want this in the uprez dop instead but anyway.

.. going to try the shader part of it tomorrow.

Link to comment
Share on other sites

fakeScatterDops.hip

Ok here is an initial trial in dops. I remember back to bunkers pyroclastic smoke example.. gas match field to make a copy of the heat field. Gas blur the heat field. then in SOP space make sure to import the blurred heat field (import pyrofields) and that should give me all the data I need.

I suppose if I were doing uprezzing, I'd want this in the uprez dop instead but anyway.

.. going to try the shader part of it tomorrow.

Link to comment
Share on other sites

oh yea, forgot the gascalculate .. that above hip will attempt to blur a volume that has nothing in it. The gas calculate needs to copy that volume over.

too tired to post the hip tonight.. will do it tomorrow AM. But its sorta looking promising.

Ok so that seems to work now.

I looked at the shader and it seems I cannot dive any deeper than the emission density node part. Is there any way to unlock the pyro2->emission density shader so i can modify it?

Do i Have to basically just modify the vex code?

-A

Edited by anupamd
Link to comment
Share on other sites

here is the fixed hip with the correct heat blurring. Im still sorta stuck on the shader as I cant seem to be able to modify the pyro2 shader. Is it a black box shader.. I thought it was suppose to be editable?

I'll dig further.. probably just doing something stupid.

Link to comment
Share on other sites

I think you could also do your field manipulations with volume operators in SOPs, after the volumes have been brought in from DOPs. That way messing around with density or heat wouldn't interfere with the simulation.

Link to comment
Share on other sites

I tried that but couldnt find a way to

A. Isolate the volume I want to manipulate.

B. Rename or copy the volume.

Essentially replicate the steps I made in dops but in sops.

I think you could also do your field manipulations with volume operators in SOPs, after the volumes have been brought in from DOPs. That way messing around with density or heat wouldn't interfere with the simulation.

Link to comment
Share on other sites

hi!

actually the built in scattering can be fast, just not with the default values.

Since avg density is linked to the smoke density by default it produces a very heavy point cloud, so if you unlink it and make it like value of 1, it should be pretty fast. Try and load the cached point cloud from disk in SOPs and examine density with various settings.

What is still slow is the internal scattering with shadows (mode).

I was just doodling with scattering and came up with this

hope it helps

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...