unity – How to use an overlapping shader so that it uses layers sort from sprite renderer and its transparent

Im using the shader from question
question

, but once I put it in the game, and my character gets close to it, it will be hidden by the shadow of the tree:

enter image description here

Any way to make the shader transparent and/or maybe use the sprite renderer sort layer system

I have been trying to use stencil configurable shader with no luck
Thank you for your help

Not sure what combination of these should work:
enter image description here

The character is using a normal sprite renderer.

How does godot’s 3d renderer work

I would like to make a 3d game in the Godot game engine. I was wondering if and how the Godot engine optimizes 3d scenes. For example some games unload chunks that the player isn’t looking at while other games (I believe) make texture quality worse the farther away you get. This would be nice to know if Godot automates any of this so that I can work with what is already built into Godot to optimize my game more.

unity – How can I use Drag handlers (IBeginDragHandler, IEndDragHandler, IDragHandler) with a 2D sprite renderer instead of a UI Image?

In my game, I assigned all of the blocks to be 2D sprites so that they could be easily converted into prefabs:
enter image description here

However, when designing the drag and drop scripts, I noticed that all of the drag and drop handlers such as IBeginDragHandler, IEndDragHandler, IDragHandler, etc. weren’t working at all. I later noticed that these were intended to be used by UI Images.

Now I am left wondering what I can do to make these 2D Sprites be usable by these functions for UI Images. Do I have any other options other than to start from scratch by making new UI Images?

Here’s the small amount of code needed to create a reproducible example:

public class DragDrop : MonoBehaviour, IBeginDragHandler, IEndDragHandler, IDragHandler
{

    public void OnBeginDrag(PointerEventData eventData)
    {
        Debug.Log("OnBeginDrag");
    }
    
    public void OnDrag(PointerEventData eventData)
    {
        Debug.Log("OnDrag");
    }

    public void OnEndDrag(PointerEventData eventData)
    {
        Debug.Log("OnEndDrag");
    }
}

rendering – Unity gizmos with custom renderer

Im working on a small project to learn the basics of post-processing, shaders and other effects in Unity.

My project is in 2D, so I followed this Brackey’s tutorial and this tutorial. The bloom effect did not work for me with the expiremental 2D renderer, so I used a forward renderer instead.

Problem is, now all of my gizmos (including the camera’s gizmos) are gone!

Anyone knows what could be the problem? Do I need to set something in the renderer so it will show?

collision detection – if touching line renderer (do something)

LineRenderer is not your friend here. While you can somehow make it work (you would need to dynamically create and update the colliders by code), that is not something you want to do. (As reference https://answers.unity.com/questions/470943/collider-for-line-renderer.html)

If you want to use your laser to kill something, it is just a bunch of stretched shiny bullet packed together. All you need to do is create a small laser prefab with an image of your laser and you spawn them in quick succession. Each of those laser bullets can have their own collider and therefore your collision/ die/ kill etc call.

With a bullet prefab, you can for example easily move your ship, continue shooting and you don’t care about already shot bullets. The line renderer would just stay where it is. You will have a really hard time to update it to match your movement pattern of the ship.

  1. instantiate a prefab should have no influence on your ships movement, if it does, you do it wrong. That would be a different problem and can only be helped if you post your implementation of it.
  2. You don’t enable/ disable bullet prefabs. You instantiate them and usually have an offscreen collider that destroys them. Upgraded version is a pool manager for them but for starters offscreen destroyer will do.

C # unit with Move GameOject Line Renderer

I am creating a DrawLine class and I want my character to follow the line I draw.

How do I move my character in the Draw Line Renderer?

Thank you so much!

public class DrawLine : MonoBehaviour
{

    public GameObject linePrefab;
    public GameObject currentLine;

    public LineRenderer lineRenderer;
    public EdgeCollider2D edgeCollider;
    public List fingerPositions;


    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            CreateLine();
        }
        if (Input.GetMouseButton(0))
        {
            Vector2 tempFingerPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            if (Vector2.Distance(tempFingerPos, fingerPositions(fingerPositions.Count - 1)) > .1f)
            {
               UpdateLine(tempFingerPos);
            }

        }
    }

    void CreateLine()
    {
        currentLine = Instantiate(linePrefab, Vector3.zero, Quaternion.identity);
        lineRenderer = currentLine.GetComponent();
        edgeCollider = currentLine.GetComponent();
        fingerPositions.Clear();
        fingerPositions.Add(Camera.main.ScreenToWorldPoint(Input.mousePosition));
        fingerPositions.Add(Camera.main.ScreenToWorldPoint(Input.mousePosition));

        lineRenderer.SetPosition(0, fingerPositions(0));
        lineRenderer.SetPosition(1, fingerPositions(1));

        edgeCollider.points = fingerPositions.ToArray();
    }



    void UpdateLine(Vector2 newFingerPos)
    {
        fingerPositions.Add(newFingerPos);
        lineRenderer.positionCount++;
        lineRenderer.SetPosition(lineRenderer.positionCount - 1, newFingerPos);
        edgeCollider.points = fingerPositions.ToArray();

    }

}


```

android – How do I organize touch and graphics code? (between GLSurfaceView and renderer)

I just need camera movement and I have something in the works, but it's an ugly hack. What's the right way to do it? The code organization or "architecture".

What I noticed is:

  • GLSurfaceView gets onTouch Recalls; but Renderer has access to GL.

  • Shaders and textures can only be loaded after the onSurfaceCreated() Callback, should it be loaded there?

  • Touch and graphics are in different threads, so they should be used queueEvent() or similar

Tutorials don't seem to cover this.

Maybe an open source game is a good example of this? Thank you for any help!

2d – SDL difference between the use of surfaces and renderer (C ++)

This is pretty well documented in the SDL1 to SDL2 Migration Guide.

Essentially, SDL_Surface is a tool for CPU-side blit rendering, whereby as SDL_Renderer uses hardware acceleration and performs the rendering on the GPU. SDL_Renderer Provides abstraction across multiple APIs and even offers a CPU-side fallback implementation if no other implementation is appropriate for your platform (unlikely).

There are very few reasons for using it SDL_Surfaces for rendering these days, unless you know 100% what you are doing (and maybe write a low-resolution ray tracer that runs on the CPU?). SDL_Renderer and be SDL_Texture is a much more powerful choice if you don't need CPU-side access to individual pixels.

Magento2 Overwriting template with plugin for Magento Sales Block Order Invoice Items issues an error if the renderer list was not found

I get an error message when I use the plugin to change the invoice line template.

Exception #0 (RuntimeException): Renderer list for block "sales.order.invoice" is not defined

This seems like a strange mistake. I tried to add a sequence in module.xml for Magento_Sales, but it still throws the error.

Is there a better way to overwrite this template file?

In my Vendor Module etc frontend di.xml


    

My plugin file Vendor Module Plugin Sales Order Invoice Items.php

_helper = $_helper;
    }

    public function beforeToHtml($subject)
    {
        if(!$this->_helper->isEnabled()) {
            return;
        }

        $subject->setTemplate("Vendor_Module::sales/order/invoice/items.phtml");
        return;
    }
}

Has anyone else experienced this? And is there a better way to work around this problem?
I am using Magento version 2.3.1.