Giter Club home page Giter Club logo

imp's People

Contributors

xraxra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imp's Issues

Add optional shadowcaster pass for Imposters

Would be good to have proper shadows from imposters, currently you can see that the imposter is attempting to cast & receive shadows when shadows enabled (renders unmodified flat quad)

Investigate freeze during 8x8 4096 imposter bake (general optimization of bake)

I'm assuming it is Compute Shader related, it might not be dividing up the thread groups in a good way at certain resolutions.
Would like to revisit the bake code and better present the baking progress while waiting, since currently there is no indication of progress. This could also help track down what is causing the freeze that was reported.

Shadow Casting

Great assets. Trying it out in my project and seems to work great when switching to my long distance camera.

Is there a way to have them cast shadows?

Regards

A question about the function FrameTransform()

I'm trying to understand FrameTransform() in ImpostorCommon.cginc, if I understand correctly it's used to find the vertex projected into the neighbor frames?

half3 ITBasis( half3 vec, half3 basedX, half3 basedY, half3 basedZ )
{
    return half3( dot(basedX,vec), dot(basedY,vec), dot(basedZ,vec) );
}
 
half3 FrameTransform( half3 projRay, half3 frameRay, out half3 worldX, out half3 worldZ  )
{
    //TODO something might be wrong here
    worldX = normalize( half3(-frameRay.z, 0, frameRay.x) );
    worldZ = normalize( cross(worldX, frameRay ) ); 
    
    projRay *= -1.0; 
    
    half3 local = normalize( ITBasis( projRay, worldX, frameRay, worldZ ) );
    return local;
}

worldX and worldZ should be the neighbor quad basis, but I have no idea what ITBasis() does here, it just finds the length of the view ray projected to the neighbor quad basis vectors but I don't understand how it relates to the projected point in the neighbor quad.

Also the way it's used
FrameTransform( projInterpolated, frame0ray, plane0x, plane0z );
where
half3 frame0ray = FrameXYToRay(frame0, framesMinusOne.xx);

frame0Ray here is the vector from octahedron center to the camera position where the frame was captured right?

Animated Imposters

Introduced in 2018.3.b5:

SkinnedMeshRenderer.forceMatrixRecalculationPerRender. This property should be set in cases where the user would like to manually render a skinned mesh multiple times within a single update, an example of this would be rendering out the results of an animation to a texture.

This would be an awesome feature -- especially if it included the ability to animate particles too.

I first noticed these being used in Super Mario Odyssey's "Cascade Kingdom", where there were clearly "Animated Imposters" for the very distant 3d background waterfall mountains surrounding the main scene. This would enable some interesting 2D-3D game element generation for distant things with limited rotations (when using, say, the half-sphere approach.)

Bug in function OctaSphereEnc() give empty frame when camera look from below

This bug can't be clearly seen when you merge 3 nearest frames like what you're doing now at here:

half3 frame0ray = FrameXYToRay(frame0, framesMinusOne.xx);
half3 frame1ray = FrameXYToRay(frame1, framesMinusOne.xx);
half3 frame2ray = FrameXYToRay(frame2, framesMinusOne.xx);

Thus to clearly see it, I edited the code to make it render one frame only which is frame0.
Now when I put the camera right below the Imposter object, the Imposter object disappear.
The bug happens in the function OctaSphereEnc() in file ImposterCommon.cginc.
I notice the bug happen when the value of vec equals (-1,-1,-1), thus I fix it by tweaking it to (0,-1,-1). Like the code beblow:

half3 OctaSphereEnc(half2 coord)
{
half3 vec = half3(coord.x, 1 - dot(1, abs(coord)), coord.y);
if (vec.y < 0)
{
if (vec.y == -1 && vec.z == -1 && vec.x == -1) //Fix the bug!!!
{
vec.x = 0;
vec.z = -1;
}
half2 flip = vec.xz >= 0 ? half2(1, 1) : half2(-1, -1);
vec.xz = (1 - abs(vec.zx)) * flip;
}
return vec;
}

But the fix isn't perfect the because the frame is still twisted a little.

Unneeded code ?

Hi,
I'm currently trying to implement this technique in my engine, and while trying to understand how it works, I've some trouble understanding this code:


   //subtract from camera pos 

    vertexOffset = normalize(objectSpaceCameraPos-vertexOffset);

    //then add the original projected world

    vertexOffset += projected;

    //remove position of vertex

    vertexOffset -= vertex.xyz;

    //add pivot

    vertexOffset += imposterPivotOffset;

If I comment the previous lines and later in the file, replace:
imp.vertex.xyz += vertexOffset;
by
imp.vertex.xyz = vertexOffset;
It looks like it gives exactly the same result.
Am I missing something ?

Q: What's the use of the dilation?

I see that dilation is done to the atlas, but why? What's the use of it? I didn't find anything related to dilation usage in the papers.

Missing Prefab errors

Thanks for posting this project! Unfortunately, when I open in 2018.1, the impostor groups in the demo scene all contain Missing Prefabs. I'm guessing this is due to missing meta files?

Platform does not support compute shaders

Platform does not support compute shaders
UnityEngine.ComputeShader:Dispatch()
ImposterBakeWindow:CaptureViews(Transform, BillboardImposter, Snapshots[], Transform, Shader, Shader, ComputeShader) (at Assets/Plugins/IMP/Editor/ImposterBakeWindow.cs:636)
ImposterBakeWindow:Draw() (at Assets/Plugins/IMP/Editor/ImposterBakeWindow.cs:179)
ImposterBakeWindow:OnGUI() (at Assets/Plugins/IMP/Editor/ImposterBakeWindow.cs:81)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.