RTX Recursive Rendering - unity3d

I am trying to achieve nice looking reflections with the unity RTX capabilities. Under the volume component, I have turned on recursive rendering:
I then set my material's rendering pass to be raytracing. The setting only allows for a ray length of 50 and I appear to get weird artefacts:
Does anyone have an idea what I'm doing wrong? What is that weird line and how do I blend it? How do I get rid of the black when an intersection exceeds the ray's length of 50 units?
Cheers!

For the first issue, I found a fix. It has to do with the light cluster: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition#7.1/manual/Ray-Tracing-Light-Cluster.html

Related

Unity Line Mesh Inward Shader

I am pretty new to shaders in unity and am stuck on a problem.
I am using ShaderGraph and unity 2021. I understood the ShaderGraph examples from the unity page and "implemented" an OutlineShader thinking I could simply "inverse" the direction (not multiply by some value to get a bigger object then coloring that object and laying the original object ontop). Yet I am nowhere near what I want.
Basically what I am trying to achive is a stepped color gradient to the inside of the object. As an image it should look something like this:
Starting from color0 (green) going inward to color1 (yellow) until i reach the center with colorN (white) and repeat the same for the other side. The shader is then used on a material that is applied to a MeshLineRenderer (LineRendererPro from asset store with minor modifications for custom behavior) which kind of looks like this:
In the end the line should be colored according to the specified colors and the direction the line is going.
Explanation of a simple "Inline" Shader (similar to an outline) would help alot. I think I would be able to adapt that concept and implement multiple colors with (maybe) percentages of width. I don't want to use a fixed image/texture since i want to change the widths and colors.
Any input is welcome and thank you in advance.

Jagged edges SkyBox realtime

I'm Completely new at setting up lights,
I have tried to adjust settings following several tutorials
but fail to find how to correct jagged objects have non crisp look
1 Unity unit = 1 meter (100cm)
Linear rendering mode is used Deferred
HDR is enabled for camera
Deferred rendering mode is used
Post Process package is installed
Enable Color Grading > Tonemapper > ACES
Help appreciated!
I altered the scene to add light probes + reflection probes,
Set static objects. Its seems to be better, although it would be nice to find how to speed up baking times... happier with the result though
In the light mapping settings I set
Direct Denoiser to OpenImageDenoise
Indirect Denoiser to OpenImageDenoise

FMod and Frac material functions cause seam in texture

Is there any way to get rid of the interpolation seam caused by using Frac or FMod? Coming from writing actual fragment shaders, I find it odd that this seam even exists (why is interpolation happening in the pixel sampling?)
Example, say we have this super simple texture
And we want the top right corner to loop instead of the whole texture, something that's easy to accomplish with an FMod.
As you can see, an artifact is now present from when the UV jumps from 0.25 to 0 and I'm not sure why. Is there a way I can disable this interpolation? With the power of MSPaint, here's what I expected to see:
I've found an okay temporary solution. If you disable mip-mapping (via the properties on the texture themselves) then the artifacts disappear. Would love to have another answer that describes how to do this while maintaining mipmaps.

How do I get a Light's Range value in Shader?

I'm trying to write a simple frag/vert shader that, depending on whether it is in the range of a light, will paint the appropriate colour from either the 'lit' texture or from the 'unlit' texture.
Therefore, I need to compare the distance between the light to the range of the light.
I've been googling all kinds of things, but I can't seem to find a way of accessing the range value of the light. Is there a way to do so? If not, is there some kind of derived data I could use as an alternative?
Update
I was able to find this method here, which seems to be the most promising so far, however after playing around for a bit, I still can't seem to get what I need. There's some talk about _LightMatrix0 not being populated. Can anyone confirm?
Update 2
I found the variable unity_LightAtten in the Unity Shader Variables documentation. However, this is only used for Vertex Lit shading, which isn't exactly ideal, especially considering the lack of console support.
Could there be a way to pipe this variable to Forward Rendering?
You can pass Light.range into the shader using Material.SetFloat. You need to attach a script to do that.

Help Required in Collision Detection Using Box2d

After some sample projects, I have started with my first game in cocos 2d and box 2d where objects fall from a parachute and you kill them using slingshot. Now i'm stuck # couple of things for a while:
Collision Issue:
Using Box 2d i have made collision with objects. However when i add a counter to get a count of my collision i doesn't work. Counter increases even though the percentile is moved out of the screen.Don't know how to get rid of this.
I'm trying to get random rotation to my sprites which fall from above, Like a parachute experience. Now all of then rotate # a same angle.
Lastly i need to get rid of the surrounding sprites when collision happens. Ex: When the percentile collides with a falling object, in a radius of 2.5 cms the other sprites should also disappear.
I Badly need help and suggestions, hence all the 3 questions # once :-). I have provided the link for my project so that you can look # the source code. Desperately looking for your help guys!!!
Download Source Code:
http://jumbofiles.com/6fn5mmpnq1q8/Karthik.zip.html
Budding Developer,
Karthik
You have a pretty good tutorial here: http://www.raywenderlich.com/475/how-to-create-a-simple-breakout-game-with-box2d-and-cocos2d-tutorial-part-12
I think that one can solve your problems :)
You can get the best tutorial for the particular requirement you have described over here.....
The link for that is as follows
http://www.raywenderlich.com/606/how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone
The tutorial is of 2 parts and describes the code briefly.. The code of that is described and you can get good amount of help from there.
ques 1 + 3: you need read link which share by Mikael and Marine
ques 2: in cocos2d, if you want get random value, you can use support function (such as: rand(), random(), CCRANDOM_0_1() ....)... i think, you need set rotation value for object. i dont know your problem, you need explain it (link is "File Not Found or Deleted / Disabled due to inactivity or DMCA")