Comments (4)
I would be very grateful for any help in solving this problem
from yocto-gl.
I think we need to create new functions like update_cutrace_cameras. For example update_cutrace_shapes, update_cutrace_instances.
I can rotate mesh or camera on CPU, but I can rotate only camera while on GPU
Here some code of animation 360:
auto funcRotation = [](float angle, float o_x, float o_y, float radius_x, float radius_y)
{
float rad_angle = angle/rad;
float point_x = o_x + radius_x * std::cos(rad_angle);
float point_y = o_y + radius_y * std::sin(rad_angle);
return vec2f{point_x,point_y};
};
for (int i=0; i<steps; ++i)
{
vec2f coord_xz = funcRotation(angle,0,0,radius_x,radius_y);
angle += angle_step;
//*** CAMERA ROTATION***
auto &cur_camera = _scene.cameras[0];
cur_camera.frame = lookat_frame({coord_xz.x, 0, coord_xz.y},{0,0,0},{0,1,0});
//*** MESH ROTATION work only with CPU***
//auto &cur_instanse = _scene.instances[0];
//cur_instanse.frame = lookat_frame({0, 0, 0},{coord_xz.x,0,coord_xz.y},{0,1,0});
#ifdef YOCTO_CUDA
update_cutrace_cameras(_context,_cuscene,_scene,_params);
reset_cutrace_state(_context,_state,_scene,_params);
trace_start(_context, _state, _cuscene, _bvh, _lights, _scene, _params);
#else
_state = make_trace_state(_scene, _params);
#endif
for (auto sample : range(0, _params.samples, _params.batch))
{
auto sample_timer = simple_timer{};
#ifdef YOCTO_CUDA
trace_samples(_context, _state, _cuscene, _bvh, _lights, _scene, _params);
#else
trace_samples(_state, _scene, _bvh, _lights, _params);
#endif
print_info("render sample {}/{}: {}", _state.samples, _params.samples, elapsed_formatted(sample_timer));
}
print_info("IMAGE render image: {}/{}", i+1, _rp.steps);
}
from yocto-gl.
So we can add or change shapes on CPU, but we can't add or change shapes on GPU. if i'm wrong, please guide me
from yocto-gl.
Yes you are right. Shapes on GPU are fixed. On CPU you can only make small changes.
In general, the system is written under the assumption that the Bvh/Light gets fully rebuild on scene changes though. This is unlikely to change in the future since we optimize for large scene rendering and not interactive applications.
from yocto-gl.
Related Issues (20)
- Update OpenImageDenoise version HOT 1
- IO Improvements
- Trace Improvements
- Core Improvements
- API improvements
- Yocto naming conventions HOT 2
- Vector index error when bvh process. HOT 1
- build error on ubuntu 22.04, gcc HOT 3
- make_rounded_uvcylinder segmentation fault HOT 1
- Suggestion: Add a "quickstart" section to README
- Possible improvements
- intersect_sphere always returns uv coordinates from the "back" of the sphere? HOT 1
- cmake configuration failed on MSYS2 MINGW64 HOT 1
- yocto_parallel.h missing string include and using directive HOT 1
- How to convert JSON format to other formats HOT 1
- Can't compile cutrace on Linux (gcc / clang) HOT 1
- Bug in save_ply
- No instance of constructor "yocto::vec2f::vec2f" matches the argument list HOT 2
- convert blender scene files to yocto scene files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yocto-gl.