Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application.renderLine(s) with duration #1852

Open
Grimeh opened this issue Feb 3, 2020 · 4 comments
Open

Application.renderLine(s) with duration #1852

Grimeh opened this issue Feb 3, 2020 · 4 comments
Assignees
Labels
area: graphics Graphics related issue feature

Comments

@Grimeh
Copy link
Contributor

Grimeh commented Feb 3, 2020

Most of the times I use pc.app.renderLine or pc.app.renderLines for debug purposes I find the lack of a duration option frustrating. I'm rarely in a position where I can call it every frame without recording it somewhere and adding the renderLine call in some script's update, which is not great.

I think both functions would benefit greatly from adding a duration option to the options parameter, where the application would draw the line(s) until the duration had elapsed.

@slimbuck
Copy link
Member

slimbuck commented Feb 3, 2020

@mvaligursky has been working on something like this

@mvaligursky mvaligursky self-assigned this Feb 3, 2020
@Maksims
Copy link
Collaborator

Maksims commented Feb 4, 2020

Seems like convenient request, but leads to very specific use case.
Implementing simple array with lines objects and their timers, is 5 minutes task, here you go: https://playcanvas.com/project/664103/overview/renderline-delay

@willeastcott
Copy link
Contributor

That project is private.

@Grimeh
Copy link
Contributor Author

Grimeh commented Feb 4, 2020

For sure, very easy to add and we have done so for almost every project, to the point where we should probably make it part of our template. But it's such useful functionality for debugging (the primary use case for renderLines I imagine?) that it seems worth the time adding to the interface.

From my experience it seems pretty standard for a "render/draw lines" function to have an optional duration, is there a particular reason for not adding it, apart from extra complexity in scene/immediate.js?

mvaligursky added a commit that referenced this issue Feb 14, 2020
…th duration, depth test, layer controls. (#1852)

- new DebugDraw with advanced debug primitive rendering
- added  static constant colors in Color class
- improved low level line rendering to handle depth testing better
- DebugDraw engine example
@willeastcott willeastcott added area: graphics Graphics related issue feature labels Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants