Skip to content

ViewportTexture doesn't work within PointLight2D #75868

Closed as not planned
Closed as not planned
@conradhappeliv

Description

@conradhappeliv

Godot version

v4.1.dev.custom_build [c1128e9]

System information

Windows 11, Nvidia 3070, any renderer

Issue description

I want to use a ViewportTexture as a PointLight2D's texture, so I can create dynamic lights, but in most scenarios, the texture won't show at all.

Scenario 1: immediately after ViewportTexture added as PointLight2D texture (works fine in editor)

image

Scenario 2: project reloaded (light texture disappears)

image

Scenario 3: in-game (no light texture shown)

image

Steps to reproduce

  1. Create a SubViewport with anything in it (e.g. a simple Sprite2D)
  2. Create a PointLight2D
  3. Add a ViewportTexture (referencing the SubViewport created in step 1) as the PointLight2D's texture
  4. Try running the game (nothing shows for the light)
  5. (optional) try adding an identical ViewportTexture as a texture on another node (e.g. Sprite2D) - it works fine.

Minimal reproduction project

viewportlight2d.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions