Giter VIP home page Giter VIP logo

hdrp-custom-passes's People

Contributors

alelievr avatar remyunity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hdrp-custom-passes's Issues

Filter See Through

Hi there, quick question, is there a way to make the See Through shader to only get activated when certain objects are in front? At the moment everything is getting detected which is sometimes not desired.

Thanks!

Transparency/depth management in FPS foreground pass

Hey—I'm very new to HDRP & custom passes, this repo has been a godsend. Thanks so much for putting it together.

I'm using your FPS foreground pass to handle rendering both 3D meshes and 2D UI elements to create a HUD. I adapted the pass a little to handle both ortho and perspectival cameras, which seems to be working great.

However, I've been having some trouble with both backface rendering and handling transparent materials in the foreground layer. With the original pass from your repo, I was (seemingly arbitrarily) seeing backfaces from some meshes writing over the same mesh's frontfaces. After checking that the model's normals were correct, I seem to have fixed this by changing line 72 from:

depthState = new DepthState(false, CompareFunction.Always),
to
depthState = new DepthState(true, CompareFunction.LessEqual)

Also, transparent objects in the foreground layer are showing as opaque. Nothing I do to ForegroundPass.cs seems to change this behavior. Turning my camera component on (for one frame, because ForegroundPass.cs immediately turns it back off) does make the material render as transparent, but it ZWrites over everything else in the foreground layer and only alpha blends with the base camera's output. Changing the material's rendering pass to Before refraction makes the object transparent & correctly alpha blend with both the foreground and background layers, but I'd prefer not to lose refraction if possible.

Did I break something somewhere? Do you have any recommended fixes for this?

Thanks, happy to provide more info if you need it.

An error occurred while resolving packages

I get this error when opening the freshly cloned project with the targeted unity version (2020.1.0a24). I also tried 2020.1.0b13 and 2019.3.10f1

image

When I open the package manager, I see these errors:

image

Only one object remains selected on run

Trying to run the Selection effect scene from the sample, without changing anything at all, in Unity 2019.3.0b6 results in that only one of the objects remains selected. When the scene is not running, all the three objects are selected in both the editor window and the scene view window:

not running:

image

running:

image

FPS Foreground Motion Vector and TAA

The latest commit seems fixed the issue of Fps Foreground with transparency and post processing. But TAA and motion vector seems doesn't work
Any clue/pointer on how to add support for TAA and motion vector to this?

Decal Projector Get Through In Foreground

I create a new hdrp project then copy all foreground asset.
using the default outdoorscene.
I really don't know what caused this to happen.
1
this is first person view look like, decal projector through fpv object.
2
this is scene view look like.

SeeThrough Question

When a layer mask is currently selected, this silhouette is drawn across all game objects. Is there currently no option to exclude or ignore this for one or more layers? That would create new possibilities.

one Example is that I can see through my Player the other one. which I don't want.
image
Any simple solution?

Not compatible with Dynamic Resolution

I am not able to get the outline to work correctly when using Dynamic Resolution. It looks like is being drawn after the resolution is applied rather than before. Any ideas for a work-around?

FPS Foreground working in game view, but not in build

Hello, title says it all. For some reason when the project is built (on Windows in this case), the screen when starting is blank. The only way to revert it I found so far is to just straight up remove the custom pass gameObject.

Some objects only get oulined in Editor depending on their shader

After i updated HDRP (not sure since which update, i'm using 7.4.3) some object are not outlined while playing in build mode.
It depends wich shader (built with Shader Graph) the object outlined is using.

Do you have any idea what a shader could do that would mess with the outline custom pass in build mode ?

Selection does not work on HDRP 8.2

Selection stopped working when switching to render pipelines high definition 8.2.0 Unity 2020.1.0f1.
But works with HDRP 8.1 Unity 2020.1.0b2

CopyBuffer from different Camera

Is it possible to Copy Color buffer from different camera to be used for RenderTexture?
using RenderFromCamera seems glitchy or is this a bug?

Outline Shader not working as expected in VR

Hi,

I am using the outline effect to highlight the Objects that the VR character can pick up or interact with.
I imported the Custom pass volume and, the SelectionColor.cs script from your original project and set the glowing objects to the right layer.

I see a double outline, one per eye.
The left eye looks correct, but for the right eye, the outline is displaced to the right of the actual object, creating a confusing effect.
image

Any ideas on how to work around this?

Thank you!

Issues with motion vector for camera rotation

Hello!

I've tried to run the CopyBuffer scene to see how motion vectors work. And there is something weird about them: when the camera is moving (translation), they seem to work correctly, with the objects being kind of visible in the motion vector display (picture 1). However, when the camera is simply looking around (no translation, rotation only), it seems that the objects don't appear (picture 2).

I'm not sure if this is just a misunderstanding of motion vectors from me or a real error, but any info about this matter would help me a lot!

Edit: I tried to copy the render texture to a normal texture in order to inspect the values using the following code, but it seems RGHalf is not the right format. The RenderTextureFormat is 29, which ... doesn't exist in the enum?

RenderTexture.active = motionVectors;
Texture2D tex = new Texture2D(motionVectors.width, motionVectors.height,  TextureFormat.RGHalf, false);
tex.ReadPixels(new Rect(0, 0, motionVectors.width, motionVectors.height), 0, 0);
tex.Apply();
byte[] bytes = tex.EncodeToEXR(Texture2D.EXRFlags.CompressZIP);
System.IO.File.WriteAllBytes(path, bytes);

Camera translation:
image

Camera rotation only:
image

Unity: 2021.2.16f1
HDRP: 12.1.6

Could you manage a Screen Space Snow / Wet effect?

Hey,
I am looking for a Screen Space Snow effect like a wet effect. And wonder if you could do it?
It should also be feasible to use a mask.
So a box that could get out of the effect.
Like, for example, there is snow or wet and inside it should be dry. Since it is a construction game, everything should be able to work without baking, as the players can build anywhere and to build a roof every time.

Translated with Google

SSAO leaks into FPS foreground

Screenshot from 2023-09-01 16-50-49

I had the same problem using the built-in DrawRenderer custom pass in HDRP when I tried to use it to prevent gun clipping, and when I found this example in this repo and tried it, it has the same problem.
is there a workaround for this?
I'm a noob to rendering and custom passes in HDRP so any help is really appreciated, thanks!

Questions about the wetness effect

Hi, the screen space wetness looks very good.
I would have a question.
Can you delete your wet in an area?
So like in the photo with the snow.
2022-11-19 04_25_23-Start

Minor SlightBlur.cs issue

If you exit Play Mode while the SlightBlur custom pass is active, you get a bunch of errors as the frame isn't released properly.

I noticed that in the Cleanup method the maskDepthBuffer.Release() wasn't checking that maskDepthBuffer wasn't null, and changing it to maskDepthBuffer?.Release() fixed the problem.

Example for additional pass

Hi, is there a good example or recommendation on how to render another pass in a shader (without a new material), or another shader entirely?

I'm trying to do an unlit render of objects with a color id map on each object to a RenderTexture (to look up later), in addition to the regular lit pass. I know I could use the Graphics api to re-render all those objects, but as far as I know, that's extra unnecessary work.

In the current examples with DrawRenderers, it looks like you need to use another material, which means then I can't have per-instance texture inputs. I also can't specify another pass without specifying a material. Do I need to make a new custom pass that takes all filtered objects, reads the current shader the object and renders with a named pass?

Thanks

Selection. Objects do not overlap the stroke

image
The orange object should not be visible.
Objects do not overlap the stroke. In the version intended for HDRP 8.2, I could not achieve overlap. In HDRP 7.2, strokes worked correctly.

Cannot implicitly convert from 'const float3' to 'float4'

Trying the much wanted Selection effect in an RTX-enabled project, which implies using the d3d11 renderer, I'm getting:

Shader error in '02_Selection/Fullscreen': cannot implicitly convert from 'const float3' to 'float4' at line 97 (on d3d11)

and if I manually fix this line, turn:

float4 c = LoadCustomColor(posInput.positionSS);

into

float4 c = float4(LoadCustomColor(posInput.positionSS), 1);

then the next place for the same error shows up:

Shader error in '02_Selection/Fullscreen': cannot implicitly convert from 'const float3' to 'float4' at line 111 (on d3d11)

Fixing both places like that gives a broken effect with the white stripes going across the whole screen, and properly colored where they pass over the "selected" object, and also there is totally no outline despite changing any settings. See the screenshot below.

image

My current Unity version is 2019.3.0b6, and HDRP 7.1.1, and I believe that your code is relying on the newest version of HDRP taken hot from its repo, because in the repository: https://github.com/Unity-Technologies/ScriptableRenderPipeline/blob/master/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl#L319 this function indeed returns float4.

Could you please clarify if this is correct? And would updating to the latest Unity 2019.3.0b8 be the right way to solve this problem?

UPDATE: Changing the LoadCustomColor() and SampleCustomColor() to return float4 instead of float3 and to take the full rgba value inside of them, instead of just rgb, solved the issue and the shaders now work as in the example. This, however, feels hacky, I don't think that modifying that file should be necessary, and, besides, the auto-generated docs in the shaders, including the Selection shaders in this repo, clearly state that those functions return float3. So the question on what would be considered an appropriate solution to this problem still remains.

overwrite depth written by RenderWithNormalBuffer

Hi! im trying to create a scope effect in HDRP that doesnt need 2 cameras to render. To do this, i am using the hd scene color node, which means i need to make sure the inside of the scope tube is not rendered over the scope image. i hoped to accomplish this in a similar way i did in URP; to not render the scope in the main pass, but rather use a custom pass to render the scope tube AFTER rendering the lens.

when i did this at first, the sight picture looked okay, but scene AO is being rendered over the scope model (which is on the transparentFX layer):
AO over scope

Sight Picture OKAY

So then i found this project, which allows me to write to the normals buffer with a custom pass. this is great, it fixed the issue where AO is rendered over the scope model! but then this happened with the hd color node from shadergraph:

no ao over scope

sight picture broken

Im hoping someone might know how i can achieve the effect i want. thanks in advance!

Outline effect not updating with mesh deformation.

Hi,

I'm using a compute shader to deform the outlined mesh. but the outline is not updating with the mesh deformation. it just keeps the initial shape of the mesh before deformation.

I also noticed that the default orange selection outline in the editor works correctly with mesh deformation.

Any idea what could be causing this issue?

Thank you!

NoTAA alpha issue

I have some problems with my incoming spout streams for transparent displays.

m340i_p90329420-b

  • The instrument custer stream renders nice. (screenshot screen between steering wheel)

  • The HUD display is an incoming spout stream with transparent alpha (screenshot)
    Is it rendered on a plane who is lying around 30cm in front of the car front window.

    When i enable NoTAA on the HUD plane the alpha from the HUD turns black.

    Is there a way to render incoming spout steam with alpha with NoTAA?

FPS Foreground dependent on camera clipping planes

Hello,
I seem to have spotted a bug / limitation in the FPS Foreground rendering. The object goes transparent when the near clipping plane is set to 0.01. If near distance is increased (to 0.3), it renders the object properly, but of course then it clips through the camera when aiming down sights. I tried to fiddle with the parameters in the script a bit - unsuccessfuly, because I have no experience in this area, so I am completely clueless. May I ask you for some advice on this issue?
Thanks for reading!

Show selection per object?

Hi,

What would be the best way to control which object should be selected beside adding/removing it from Selection layer? ;)

Thanks

Outline with hdrp volumetrics not showing colors

Hi, I have an issue with the outline shader example (using unity 2020.2.5f1 ).
The outline is specified as red in the fullscreen pass, however it shows up black and only red when there's a density volume over it. So first thing I thought it's because of the volumetrics. But turning them off doesn't fix the issue as it remains black. I tried turning off everything one by one (also post effects), but it just stays black. Also tried different injection points, maybe you have any thoughts about this ?
Thanks!

image

image

Baking Custom Pass stretched texture

In the Camera Depth Baking scene, the baking camera is stretched when the main view aspect ratio changes. This is different from the behavior when setting a target texture in the camera which respects the target texture's aspect ratio. What is causing this and is it possible to replicate the behavior of the baking to a target texture?

Render from different camera to a texture/rendertexture

Is it possible to from different camera and output the frame buffer to a texture/rendertexture with custom pass?
my use case is for minimap , a custom buffer for terrain deformation or water ripple.
any chance to get a small sample scene for this?
I guess it's similar to CopyPass sample but rendered from different camera?

FPS Foreground clipping issues

I need the near-clip of the camera to be low enough to prevent clipping when the weapon is very close to the screen (i.e. when recoil pushes the weapon back). I'm using a value of 0.03 which seems reasonable, but the custom pass seems to break and render only the a small section of the weapon, closest to the camera, as if it is being affected by a far-clip, but it's not.

I attempted to edit the custom pass to use different near and far clip values for the FPSForegroundCamera that's made at runtime, but no matter how I tweak the values, there's some kind of clipping error.

I don't know much about custom passes and I really don't know what could be causing this issue. Perhaps it can be solved with a certain configuration, but after an hour and a half of trying to figure it out myself, I decided to make this issue.

Thanks.

render object and camera motion vectors

Huge thanks for sharing your stuff, this is great! I was just wondering how one would go about modifying RenderMotionVectors.cs to not only get object motion vectors but also camera motion vectors, do you have any pointers by chance? Thanks!

question: custom pass for rendering video texture or spout stream (incoming render texture)

Hi,

Thaks for the nice demos. Very useful.

Would it be possible to add an custom pass who allows to have a clean rendering of
a video texture or incoming render texture stream (spout stream).

TAA and DOF should work in this example.
For now TAA is smearing the the video or render texture stream or DOF is not working.

As an use case we have full ui simulations for e.g both of these screens of the car interior where you can interact with (touch display). These are streamed in to the material as render textures. Movie textures are another use case.
https://beforesandafters.com/wp-content/uploads/2019/04/UNITY_RT_05-768x432.jpg

For now there is no solution that TAA and DOF is working and to display crisp content on both of the interior displays when camera is moving or you drive the car.

Thanks.

edit:
Extendind this example

https://user-images.githubusercontent.com/6877923/99796085-29382480-2b2d-11eb-89b8-73c1cd16af48.png

by mapping the UI per RT Texture to one of the green motor blocks would be a good use case and would be working with you demo assets. Alternativ a video texure mapped on one of the green motor blocks.

For now when the ui is scrolling or something is moving inside the UI (rt texture or video texture in material) the TAA smears the motion or when you do an after postprocess dof is not working.

FPS Foreground can see through my objects

Hi, i have seen the issue has been posted before and a change was made but with the current version it happens again.
When i turn towards an object i can slightly see through the foreground layer and i have no idea why?

Liquid not working on 2023.1.5f1

Just tried to open the project in 2023.1.5f1.

The conversion has some problems with the Liquid.shadergraph that needs TargetSettings to HDRP.
But although I soved that problem, the custom pass draws black custom buffers (checked in the Frame Debugger)

I'm stuck. Please help.

Feature Request: Lens Distortion

Hi, is there a way I can affect a layer with certain post processing effects?
I want to use the lens distortion post-processing effect on my UI elements so I can imitate a curved UI screen.

Is this possible?

It would be great in general if I could just choose any post-processing effect and have those effects only affect a certain layer in my game.

I hope you can help

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.